12#include "GaudiKernel/AlgFactory.h"
13#include "GaudiKernel/DataObject.h"
14#include "GaudiKernel/IEventProcessor.h"
16#include "GaudiKernel/Incident.h"
17#include "GaudiKernel/IIncidentSvc.h"
18#include "GaudiKernel/Memory.h"
23#include "GaudiKernel/ISvcLocator.h"
24#include "GaudiKernel/IDataProviderSvc.h"
25#include "GaudiKernel/Bootstrap.h"
26#include "GaudiKernel/RegistryEntry.h"
27#include "GaudiKernel/MsgStream.h"
29#include "CgemRawEvent/CgemDigi.h"
30#include "CgemRecEvent/RecCgemCluster.h"
32#include "Identifier/CgemID.h"
33#include "RawEvent/RawDataUtil.h"
34#include "RawEvent/DigiEvent.h"
35#include "ReconEvent/ReconEvent.h"
36#include "EventModel/EventHeader.h"
37#include "GaudiKernel/SmartDataPtr.h"
39#include "ReadCosmicRayData/TestMapping.h"
45 Algorithm(name,pSvcLocator){
47 declareProperty(
"CosmicRayDataSetID", CosmicRayDataSetID =
"CR201909");
52 MsgStream log(
msgSvc(), name());
53 log << MSG::INFO <<
"TestMapping initialize()" << endreq;
55 StatusCode sc = service(
"CgemGeomSvc", m_geomSvc);
56 if(sc != StatusCode::SUCCESS) {
57 log << MSG::ERROR <<
"can not use CgemGeomSvc" << endreq;
58 return StatusCode::FAILURE;
61 output =
new TFile(
"Mappingtest_histo.root",
"RECREATE");
67 return StatusCode::SUCCESS;
72 MsgStream log(
msgSvc(), name());
73 cout <<
"->TestMapping::execute" << endl;
74 cout <<
"geomtry service pointer " << m_geomSvc << endl;
75 return StatusCode::SUCCESS;
81 const int nsheet[nlayer] = {1, 2, 2};
83 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}};
85 for(
int ilayer = 0; ilayer < nlayer; ilayer++) {
86 for(
int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
93 double anode_radius_x = anode->
getRX();
94 double anode_radius_v = anode->
getRV();
96 for(
int iview = 0; iview < nview; iview++) {
99 if(iview==1) nstrip = nvstrip;
101 for(
int istrip=0; istrip < nstrip; istrip++) {
113 stripid_L1_x[istrip] = stripid;
115 phi_L1_S1[istrip] = phi;
117 else if(layerid==1 && sheetid==0) {
118 stripid_L2_x[istrip] = stripid;
120 phi_L2_S1[istrip] = phi;
122 else if(layerid==1 && sheetid==1) {
124 phi_L2_S2[istrip] = phi;
126 else if(layerid==2 && sheetid==0) {
127 stripid_L3_x[istrip] = stripid;
129 phi_L3_S1[istrip] = phi;
131 else if(layerid==2 && sheetid==1) {
133 phi_L3_S2[istrip] = phi;
140 stripid_L1_v[istrip] = stripid;
143 else if(layerid==1 && sheetid==0) {
144 stripid_L2_v[istrip] = stripid;
147 else if(layerid==1 && sheetid==1) v_L2_S2[istrip] =
v;
148 else if(layerid==2 && sheetid==0) {
149 stripid_L3_v[istrip] = stripid;
152 else if(layerid==2 && sheetid==1) v_L3_S2[istrip] =
v;
165 if(CosmicRayDataSetID==
"CR201909") {
167 const int nlayer = 3;
168 const int nsheet[nlayer] = {1, 2, 2};
170 const int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}};
172 double pitch = 0.660;
173 double anode_radius[3] = {90., 132.5, 175};
174 double overlap_gap[3] = {0.407, 0.32, 0.415};
177 for(
int ilayer = 0; ilayer < nlayer; ilayer++) {
178 for(
int iview = 0; iview < nview; iview++) {
179 int ntot = nstrip[ilayer][iview] * nsheet[ilayer];
181 for(
int istrip = 0; istrip < ntot; istrip++) {
182 int stripid = istrip+1;
185 phi = TMath::TwoPi() - (pitch/anode_radius[ilayer]) * stripid;
186 double x =
cos(phi) * anode_radius[ilayer];
187 double z =
sin(phi) * anode_radius[ilayer];
188 double phi_corr = TMath::Pi() - phi;
191 stripid_L1_x_GRAAL[istrip] = stripid;
192 x_L1_GRAAL[istrip] =
x;
193 z_L1_GRAAL[istrip] = z;
194 phi_L1_GRAAL[istrip] = phi;
195 phi_L1_GRAAL_corr[istrip] = phi_corr;
198 stripid_L2_x_GRAAL[istrip] = stripid;
199 x_L2_GRAAL[istrip] =
x;
200 z_L2_GRAAL[istrip] = z;
201 phi_L2_GRAAL[istrip] = phi;
202 phi_L2_GRAAL_corr[istrip] = phi_corr;
205 stripid_L3_x_GRAAL[istrip] = stripid;
206 x_L3_GRAAL[istrip] =
x;
207 z_L3_GRAAL[istrip] = z;
208 phi_L3_GRAAL[istrip] = phi;
209 phi_L3_GRAAL_corr[istrip] = phi_corr;
227 MsgStream log(
msgSvc(),name());
228 log << MSG::INFO <<
"TestMapping finalize()" << endreq;
230 gs_L1_S1 =
new TGraph(
nstrip_L1_x, stripid_L1_x, s_L1_S1);
231 gphi_L1_S1 =
new TGraph(
nstrip_L1_x, stripid_L1_x, phi_L1_S1);
232 gv_L1_S1 =
new TGraph(
nstrip_L1_v, stripid_L1_v, v_L1_S1);
234 gs_L2_S1 =
new TGraph(
nstrip_L2_x, stripid_L2_x, s_L2_S1);
235 gphi_L2_S1 =
new TGraph(
nstrip_L2_x, stripid_L2_x, phi_L2_S1);
236 gv_L2_S1 =
new TGraph(
nstrip_L2_v, stripid_L2_v, v_L2_S1);
237 gs_L2_S2 =
new TGraph(
nstrip_L2_x, stripid_L2_x, s_L2_S2);
238 gphi_L2_S2 =
new TGraph(
nstrip_L2_x, stripid_L2_x, phi_L2_S2);
239 gv_L2_S2 =
new TGraph(
nstrip_L2_v, stripid_L2_v, v_L2_S2);
241 gs_L3_S1 =
new TGraph(
nstrip_L3_x, stripid_L3_x, s_L3_S1);
242 gphi_L3_S1 =
new TGraph(
nstrip_L3_x, stripid_L3_x, phi_L3_S1);
243 gv_L3_S1 =
new TGraph(
nstrip_L3_v, stripid_L3_v, v_L3_S1);
244 gs_L3_S2 =
new TGraph(
nstrip_L3_x, stripid_L3_x, s_L3_S2);
245 gphi_L3_S2 =
new TGraph(
nstrip_L3_x, stripid_L3_x, phi_L3_S2);
246 gv_L3_S2 =
new TGraph(
nstrip_L3_v, stripid_L3_v, v_L3_S2);
248 gs_L1_S1->SetName(
"gs_L1_S1");
249 gphi_L1_S1->SetName(
"gphi_L1_S1");
250 gv_L1_S1->SetName(
"gv_L1_S1");
252 gs_L2_S1->SetName(
"gs_L2_S1");
253 gphi_L2_S1->SetName(
"gphi_L2_S1");
254 gv_L2_S1->SetName(
"gv_L2_S1");
255 gs_L2_S2->SetName(
"gs_L2_S2");
256 gphi_L2_S2->SetName(
"gphi_L2_S2");
257 gv_L2_S2->SetName(
"gv_L2_S2");
259 gs_L3_S1->SetName(
"gs_L3_S1");
260 gphi_L3_S1->SetName(
"gphi_L3_S1");
261 gv_L3_S1->SetName(
"gv_L3_S1");
262 gs_L3_S2->SetName(
"gs_L3_S2");
263 gphi_L3_S2->SetName(
"gphi_L3_S2");
264 gv_L3_S2->SetName(
"gv_L3_S2");
285 gx_L1_GRAAL =
new TGraph(
nstrip_L1_x, stripid_L1_x_GRAAL, x_L1_GRAAL);
286 gz_L1_GRAAL =
new TGraph(
nstrip_L1_x, stripid_L1_x_GRAAL, z_L1_GRAAL);
287 gphi_L1_GRAAL =
new TGraph(
nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL);
288 gv_L1_GRAAL =
new TGraph(
nstrip_L1_v, stripid_L1_v_GRAAL, v_L1_GRAAL);
290 gx_L2_GRAAL =
new TGraph(2*
nstrip_L2_x, stripid_L2_x_GRAAL, x_L2_GRAAL);
291 gz_L2_GRAAL =
new TGraph(2*
nstrip_L2_x, stripid_L2_x_GRAAL, z_L2_GRAAL);
292 gphi_L2_GRAAL =
new TGraph(2*
nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL);
293 gv_L2_GRAAL =
new TGraph(2*
nstrip_L2_v, stripid_L2_v_GRAAL, v_L2_GRAAL);
295 gx_L3_GRAAL =
new TGraph(2*
nstrip_L3_x, stripid_L3_x_GRAAL, x_L3_GRAAL);
296 gz_L3_GRAAL =
new TGraph(2*
nstrip_L3_x, stripid_L3_x_GRAAL, z_L3_GRAAL);
297 gphi_L3_GRAAL =
new TGraph(2*
nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL);
298 gv_L3_GRAAL =
new TGraph(2*
nstrip_L3_v, stripid_L3_v_GRAAL, v_L3_GRAAL);
300 gx_L1_GRAAL->SetName(
"gx_L1_GRAAL");
301 gz_L1_GRAAL->SetName(
"gz_L1_GRAAL");
302 gphi_L1_GRAAL->SetName(
"gphi_L1_GRAAL");
303 gv_L1_GRAAL->SetName(
"gv_L1_GRAAL");
305 gx_L2_GRAAL->SetName(
"gx_L2_GRAAL");
306 gz_L2_GRAAL->SetName(
"gz_L2_GRAAL");
307 gphi_L2_GRAAL->SetName(
"gphi_L2_GRAAL");
308 gv_L2_GRAAL->SetName(
"gv_L2_GRAAL");
310 gx_L3_GRAAL->SetName(
"gx_L3_GRAAL");
311 gz_L3_GRAAL->SetName(
"gz_L3_GRAAL");
312 gphi_L3_GRAAL->SetName(
"gphi_L3_GRAAL");
313 gv_L3_GRAAL->SetName(
"gv_L3_GRAAL");
315 gx_L1_GRAAL->Write();
316 gz_L1_GRAAL->Write();
317 gphi_L1_GRAAL->Write();
318 gv_L1_GRAAL->Write();
320 gx_L2_GRAAL->Write();
321 gz_L2_GRAAL->Write();
322 gphi_L2_GRAAL->Write();
323 gv_L2_GRAAL->Write();
325 gx_L3_GRAAL->Write();
326 gz_L3_GRAAL->Write();
327 gphi_L3_GRAAL->Write();
328 gv_L3_GRAAL->Write();
331 gphi_L1_GRAAL_corr =
new TGraph(
nstrip_L1_x, stripid_L1_x_GRAAL, phi_L1_GRAAL_corr);
332 gphi_L2_GRAAL_corr =
new TGraph(2*
nstrip_L2_x, stripid_L2_x_GRAAL, phi_L2_GRAAL_corr);
333 gphi_L3_GRAAL_corr =
new TGraph(2*
nstrip_L3_x, stripid_L3_x_GRAAL, phi_L3_GRAAL_corr);
335 gphi_L1_GRAAL_corr->SetName(
"gphi_L1_GRAAL_corr");
336 gphi_L2_GRAAL_corr->SetName(
"gphi_L2_GRAAL_corr");
337 gphi_L3_GRAAL_corr->SetName(
"gphi_L3_GRAAL_corr");
339 gphi_L1_GRAAL_corr->Write();
340 gphi_L2_GRAAL_corr->Write();
341 gphi_L3_GRAAL_corr->Write();
348 return StatusCode::SUCCESS;
double sin(const BesAngle a)
double cos(const BesAngle a)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
double getCentralXFromXID(int X_ID) const
double getCentralVFromVID(int V_ID) const
double getPhiFromXID(int X_ID) const
static int strip(const Identifier &id)
static bool is_xstrip(const Identifier &id)
static Identifier strip_id(int f_layer, int f_sheet, int f_strip_type, int f_strip)
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0
TestMapping(const std::string &name, ISvcLocator *pSvcLocator)