CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
ReadCosmicRayData Class Reference

#include <ReadCosmicRayData.h>

+ Inheritance diagram for ReadCosmicRayData:

Public Member Functions

 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 ReadCosmicRayData (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~ReadCosmicRayData ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Constructor & Destructor Documentation

◆ ReadCosmicRayData() [1/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 60 of file bak_ReadCosmicRayData-00-00-04/src/ReadCosmicRayData.cxx.

60 :
61 Algorithm(name,pSvcLocator){
62
63 declareProperty("Dir_file", Dir_file = "Cosmic_data_01.root");
64 declareProperty("TreeDigi", TreeDigi = "t1");
65 declareProperty("TreeCluster", TreeCluster = "t1");
66 declareProperty("ReadDigi", ReadDigi = true);
67 declareProperty("ReadCluster", ReadCluster = true);
68 declareProperty("DigiSheetID", DigiSheetID = 0);
69 declareProperty("Cut_on_tpc", Cut_on_tpc = false);
70 declareProperty("ClusterSheetID", ClusterSheetID = 0);
71 declareProperty("ClusterRecZ", ClusterRecZ = 0);
72 declareProperty("R_Cluster", R_Cluster = 1.0);
73 declareProperty("Shift_DigitLayerID", Shift_DigitLayerID = 0);
74 declareProperty("Shift_DigitSheetID", Shift_DigitSheetID = 0);
75 declareProperty("Shift_DigitXStripID", Shift_DigitXStripID = 0);
76 declareProperty("Shift_DigitVStripID", Shift_DigitVStripID = 0);
77 declareProperty("Shift_ClusterLayerID", Shift_ClusterLayerID = 0);
78 declareProperty("Shift_ClusterSheetID", Shift_ClusterSheetID = 0);
79 declareProperty("Shift_RecPhi", Shift_RecPhi = 0);
80 declareProperty("Shift_RecV", Shift_RecV = 0);
81 declareProperty("Shift_RecZ", Shift_RecZ = 0);
82 declareProperty("CosmicRayDataSetID", CosmicRayDataSetID = "CR201909");
83
84}

◆ ~ReadCosmicRayData() [1/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

Definition at line 86 of file bak_ReadCosmicRayData-00-00-04/src/ReadCosmicRayData.cxx.

86 {
87}

◆ ReadCosmicRayData() [2/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [2/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [3/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [3/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [4/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [4/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [5/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [5/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [6/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [6/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [7/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [7/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [8/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [8/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

◆ ReadCosmicRayData() [9/9]

ReadCosmicRayData::ReadCosmicRayData ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

◆ ~ReadCosmicRayData() [9/9]

ReadCosmicRayData::~ReadCosmicRayData ( )

Member Function Documentation

◆ execute() [1/9]

StatusCode ReadCosmicRayData::execute ( )

Definition at line 455 of file bak_ReadCosmicRayData-00-00-04/src/ReadCosmicRayData.cxx.

455 {
456
457 MsgStream log(msgSvc(), name());
458 if(ReadDigi&&!ReadCluster) log << MSG::INFO << "ReadCosmicRayData execute(): "<<Ind_Entry_D+1<<"/"<<No_Entries_D<<" events are finished !" << endreq;
459 if(!ReadDigi&&ReadCluster) log << MSG::INFO << "ReadCosmicRayData execute(): "<<Ind_Entry_C+1<<"/"<<No_Entries_C<<" events are finished !" << endreq;
460 if(ReadDigi&&ReadCluster) log << MSG::INFO << "ReadCosmicRayData execute(): "<<Ind_Entry_C+1<<"/"<<No_Entries_C<<" events are finished !" << endreq;
461
462 //interface to event data service
463 ISvcLocator* svcLocator = Gaudi::svcLocator();
464 StatusCode sc=svcLocator->service("EventDataSvc", m_evtSvc);
465 if (sc.isFailure())
466 cout<<"Could not accesss EventDataSvc!"<<endl;
467
468 if(ReadDigi)
469 {
470 DigiEvent* aDigiEvent = new DigiEvent;
471 sc = m_evtSvc->registerObject("/Event/Digi",aDigiEvent);
472 if(sc!=StatusCode::SUCCESS) {
473 cout<< "Could not register DigiEvent" <<endl;
474 }
475
476 ReadCgemDigits();
477 SaveCgemDigits();
478 //cout<<"Ind_Entry_D "<<Ind_Entry_D<<", Max_Ind_Entry_D "<<No_Entries_D<<endl;
479
480 if(Ind_Entry_D==No_Entries_D)
481 {
482 log << MSG::INFO << "scheduling a event processing stop...." << endreq;
483 SmartIF<IEventProcessor> ep(serviceLocator());
484 if (ep) ep->stopRun();
485 }
486
487 }
488 if(ReadCluster)
489 {
490 ReconEvent* aReconEvent = new ReconEvent;
491 sc = m_evtSvc->registerObject("/Event/Recon",aReconEvent);
492 if(sc!=StatusCode::SUCCESS) {
493 cout<< "Could not register ReconEvent" <<endl;
494 }
495
496 ReadCgemClusters();
497 SaveCgemClusters();
498 //cout<<"Ind_Entry_C "<<Ind_Entry_C<<", Max_Ind_Entry_C "<<No_Entries_C<<endl;
499 if(Ind_Entry_C==No_Entries_C)
500 {
501 log << MSG::INFO << "scheduling a event processing stop...." << endreq;
502 SmartIF<IEventProcessor> ep(serviceLocator());
503 if (ep) ep->stopRun();
504 }
505 }
506 return StatusCode::SUCCESS;
507}

◆ execute() [2/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [3/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [4/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [5/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [6/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [7/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [8/9]

StatusCode ReadCosmicRayData::execute ( )

◆ execute() [9/9]

StatusCode ReadCosmicRayData::execute ( )

◆ finalize() [1/9]

StatusCode ReadCosmicRayData::finalize ( )

const int nlayer = 3; // CHECK hardcoded const int nsheet[nlayer] = {1, 2, 2}; // CHECK hardcoded const int nview = 2; // CHECK hardcoded int nstrip[nlayer][nview] = {{856, 1173}, {630, 1077}, {832, 1395}}; // CHECK hardcoded

int layer=1; int sheet=0; int type=0; for(int strip=0; strip<nstrip[layer][type]; strip++) { cout << strip << " " << mapper->GetGEMROC(strip, type, layer, sheet) << " "
<< mapper->GetFEB(strip, type, layer, sheet) << " " << mapper->GetTIGER(strip, type, layer, sheet) << endl; }

Definition at line 509 of file bak_ReadCosmicRayData-00-00-04/src/ReadCosmicRayData.cxx.

509 {
510 MsgStream log(msgSvc(),name());
511 log << MSG::INFO << "ReadCosmicRayData finalize()" << endreq;
512
513 return StatusCode::SUCCESS;
514}

◆ finalize() [2/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [3/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [4/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [5/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [6/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [7/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [8/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ finalize() [9/9]

StatusCode ReadCosmicRayData::finalize ( )

◆ initialize() [1/9]

StatusCode ReadCosmicRayData::initialize ( )
 if(ReadCluster)
 {

Get Cgem cluster tree TString TTreeCluster(TreeCluster); Tcluster = (TTree*)f->Get(TTreeCluster);

Tcluster->SetBranchAddress("Event", &m_Event_C); Tcluster->SetBranchAddress("GemCluster1d_nCluster", &m_nGemCluster); Tcluster->SetBranchAddress("GemCluster1d_nHit", m_ClusternHit); Tcluster->SetBranchAddress("GemCluster1d_HitIndex", m_ClusterHitIndex); Tcluster->SetBranchAddress("GemCluster1d_plane", m_ClusterLayerID); Tcluster->SetBranchAddress("GemCluster1d_view", m_Flag); Tcluster->SetBranchAddress("GemCluster1d_q", m_EnergyDeposit); Tcluster->SetBranchAddress("GemCluster1d_x", m_Cluster_x); Tcluster->SetBranchAddress("GemCluster1d_z", m_Cluster_z); Tcluster->SetBranchAddress("GemCluster1d_x_cc", m_Cluster_x_cc); Tcluster->SetBranchAddress("GemCluster1d_x_tpc", m_Cluster_x_tpc); Tcluster->SetBranchAddress("GemCluster1d_z_cc", m_Cluster_z_cc); Tcluster->SetBranchAddress("GemCluster1d_z_tpc", m_Cluster_z_tpc); Tcluster->SetBranchAddress("ClusterSheetID", m_ClusterSheetID); Tcluster->SetBranchAddress("ClusterFlagB", m_ClusterFlagB); Tcluster->SetBranchAddress("ClusterFlagE", m_ClusterFlagE); Tcluster->SetBranchAddress("RecV", m_RecV); Tcluster->SetBranchAddress("RecZ", m_RecZ);

 No_Entries_C = Tcluster->GetEntries();
 Ind_Entry_C = 0;
 }

Definition at line 89 of file bak_ReadCosmicRayData-00-00-04/src/ReadCosmicRayData.cxx.

89 {
90 MsgStream log(msgSvc(), name());
91 log << MSG::INFO << "ReadCosmicRayData initialize()" << endreq;
92
93 TString TDir_file(Dir_file);
94 f = new TFile(TDir_file);
95 if(ReadDigi)
96 {
97 TString TTreeDigi(TreeDigi);
98 Tdigi = (TTree*)f->Get(TTreeDigi);
99
100 // Get Cgem digi tree
101 Tdigi->SetBranchAddress("Event", &m_Event_D); // event ID
102 Tdigi->SetBranchAddress("nGemHit", &m_nGemHit); // nof GEM hits
103 // Tdigi->SetBranchAddress("GemHit_nHit", &m_nGemHit); // nof GEM hits it is the same thing as before
104
105 // information on the IDs
106 Tdigi->SetBranchAddress("GemHit_channel", m_channel); // channel no. [0, 63]
107 Tdigi->SetBranchAddress("GemHit_ROC", m_ROC); // ROC no.
108 Tdigi->SetBranchAddress("GemHit_chip", m_chip); // chip no.
109 Tdigi->SetBranchAddress("GemHit_FEB", m_FEB); // FEB no.
110 Tdigi->SetBranchAddress("GemHit_plane", m_plane); // plane
111 Tdigi->SetBranchAddress("GemHit_view", m_view); // view (axial or stereo strips)
112 Tdigi->SetBranchAddress("GemHit_strip", m_strip); // strip no.
113
114 // physical information
115 Tdigi->SetBranchAddress("GemHit_saturated", m_saturated); // is the ASIC channel saturated
116 Tdigi->SetBranchAddress("GemHit_q", m_charge); // charge (fC)
117 Tdigi->SetBranchAddress("GemHit_time", m_time); // time (ns)
118 // Tdigi->SetBranchAddress("GemHit_is_tpc", m_GemHit_is_tpc);
119
120 No_Entries_D = Tdigi->GetEntries();
121 Ind_Entry_D = 0;
122 }
123
124 /**
125 if(ReadCluster)
126 {
127 //Get Cgem cluster tree
128 TString TTreeCluster(TreeCluster);
129 Tcluster = (TTree*)f->Get(TTreeCluster);
130
131 Tcluster->SetBranchAddress("Event", &m_Event_C);
132 Tcluster->SetBranchAddress("GemCluster1d_nCluster", &m_nGemCluster);
133 Tcluster->SetBranchAddress("GemCluster1d_nHit", m_ClusternHit);
134 Tcluster->SetBranchAddress("GemCluster1d_HitIndex", m_ClusterHitIndex);
135 Tcluster->SetBranchAddress("GemCluster1d_plane", m_ClusterLayerID);
136 Tcluster->SetBranchAddress("GemCluster1d_view", m_Flag);
137 Tcluster->SetBranchAddress("GemCluster1d_q", m_EnergyDeposit);
138 Tcluster->SetBranchAddress("GemCluster1d_x", m_Cluster_x);
139 Tcluster->SetBranchAddress("GemCluster1d_z", m_Cluster_z);
140 Tcluster->SetBranchAddress("GemCluster1d_x_cc", m_Cluster_x_cc);
141 Tcluster->SetBranchAddress("GemCluster1d_x_tpc", m_Cluster_x_tpc);
142 Tcluster->SetBranchAddress("GemCluster1d_z_cc", m_Cluster_z_cc);
143 Tcluster->SetBranchAddress("GemCluster1d_z_tpc", m_Cluster_z_tpc);
144 //Tcluster->SetBranchAddress("ClusterSheetID", m_ClusterSheetID);
145 //Tcluster->SetBranchAddress("ClusterFlagB", m_ClusterFlagB);
146 //Tcluster->SetBranchAddress("ClusterFlagE", m_ClusterFlagE);
147 //Tcluster->SetBranchAddress("RecV", m_RecV);
148 //Tcluster->SetBranchAddress("RecZ", m_RecZ);
149
150 No_Entries_C = Tcluster->GetEntries();
151 Ind_Entry_C = 0;
152 }
153 **/
154
155 return StatusCode::SUCCESS;
156}

◆ initialize() [2/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [3/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [4/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [5/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [6/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [7/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [8/9]

StatusCode ReadCosmicRayData::initialize ( )

◆ initialize() [9/9]

StatusCode ReadCosmicRayData::initialize ( )

The documentation for this class was generated from the following files: