CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemClusterCreate Class Reference

#include <CgemClusterCreate.h>

+ Inheritance diagram for CgemClusterCreate:

Public Member Functions

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

Detailed Description

Definition at line 37 of file CgemClusterCreate.h.

Constructor & Destructor Documentation

◆ CgemClusterCreate()

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

Definition at line 73 of file CgemClusterCreate.cxx.

73 :
74 Algorithm(name,pSvcLocator)
75{
76 declareProperty("PrintFlag",myPrintFlag=0);
77 declareProperty("MotherParticleID",myMotherParticleID=443);
78 declareProperty("Method",myMethod=2);
79 declareProperty("ntuple",myNtuple=0);
80 declareProperty("effCluster",myClusterEff=1.0);
81 declareProperty("fillOpt",m_fillOption=-1);
82 declareProperty("selGoodDigi",m_selGoodDigi=1);
83 declareProperty("minDigiTime",m_minDigiTime=-8875);
84 declareProperty("maxDigiTime",m_maxDigiTime=-8562);
85 declareProperty("TPCFitMethod",m_selectTPC=1);
86 declareProperty("minQDigi",myQMin=0.0);
87 declareProperty("LUTfile", m_LUTfile = "LUTfile.root");
88 declareProperty("clustering_gap", clustering_gap = 0);
89 declareProperty("dropHitRandomly", myDropHit = 0);
90 declareProperty("uTPC_correction", uTPC_correction = true);
91
92 // --- for random noise (toy cluster)
93 declareProperty("addRandomToyCluster", myRandomCluster=0);
94 declareProperty("NoiseRate_layer1", myNoiseRate[0]=0.0);
95 declareProperty("NoiseRate_layer2", myNoiseRate[1]=0.0);
96 declareProperty("NoiseRate_layer3", myNoiseRate[2]=0.0);
97
98
99 if(myMethod==0) reset();
100 else if(myMethod==1||myMethod==3) resetFiredStripMap();
101
102 m_totEvt = 0;
103 m_nStripRead=0;
104 m_iStripToDrop=-1;
105}

◆ ~CgemClusterCreate()

CgemClusterCreate::~CgemClusterCreate ( )

Definition at line 107 of file CgemClusterCreate.cxx.

108{
109 delete lutreader;
110}

Member Function Documentation

◆ execute()

StatusCode CgemClusterCreate::execute ( )

Definition at line 201 of file CgemClusterCreate.cxx.

202{
203 MsgStream log(msgSvc(), name());
204 log << MSG::INFO << "in execute()" << endreq;
205
206 // check and register /Event/Recon
207 DataObject *aReconEvent;
208 eventSvc()->findObject("/Event/Recon",aReconEvent);
209 if(aReconEvent==NULL) {
210 aReconEvent = new ReconEvent();
211 StatusCode sc = eventSvc()->registerObject("/Event/Recon",aReconEvent);
212 if(sc!=StatusCode::SUCCESS) {
213 log << MSG::FATAL << "Could not register ReconEvent" <<endreq;
214 return( StatusCode::FAILURE);
215 }
216 }
217
218
219 if(myMethod==0) method0();
220 else if(myMethod==1) method1();
221 else if(myMethod==2) toyCluster();
222 else if(myMethod==3) method2();
223 m_totEvt++;
224
225 return StatusCode::SUCCESS;
226}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode CgemClusterCreate::finalize ( )

Definition at line 2132 of file CgemClusterCreate.cxx.

2133{
2134 MsgStream log(msgSvc(),name());
2135 log << MSG::INFO << "in finalize(): Number of events in CgemClusterCreate" << m_totEvt << endreq;
2136 //delete myNTupleHelper;
2137
2138 return StatusCode::SUCCESS;
2139}

◆ initialize()

StatusCode CgemClusterCreate::initialize ( )

Definition at line 112 of file CgemClusterCreate.cxx.

113{
114 MsgStream log(msgSvc(), name());
115 log << MSG::INFO << "in initialize()" << endreq;
116
117 //CgemGeomSvc//
118 // StatusCode sc;
119 // ICgemGeomSvc* ISvcCgem;
120 // sc = service("CgemGeomSvc", ISvcCgem);
121 // if(sc != StatusCode::SUCCESS)
122 // {
123 // log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
124 // return StatusCode::FAILURE;
125 // }
126
127 //BesTimerSvc//
128 StatusCode tsc;
129 IBesTimerSvc* m_timersvc;
130 tsc = service( "BesTimerSvc", m_timersvc);
131 if( tsc.isFailure() )
132 {
133 log << MSG::WARNING << name() << " Unable to locate BesTimerSvc" << endreq;
134 return StatusCode::FAILURE;
135 }
136 m_timer = m_timersvc->addItem("Execution");
137
138 if(myNtuple) myNTupleHelper=new NTupleHelper(ntupleSvc()->book("RecCgem/CgemCluster",CLID_ColumnWiseTuple,"CgemCluster"));
139
140 if(myMethod==0||myMethod==2) {
141 if(myNtuple) hist_def();
142 }
143
144 // --- get CgemGeomSvc ---
145 ISvcLocator* svcLocator = Gaudi::svcLocator();
146 ICgemGeomSvc* ISvc;
147 StatusCode sc=svcLocator->service("CgemGeomSvc", ISvc);
148 myCgemGeomSvc=dynamic_cast<CgemGeomSvc *>(ISvc);
149 //StatusCode sc = service( "CgemGeomSvc", myCgemGeomSvc);
150 if (!sc.isSuccess()) log<< MSG::INFO << "CgemClusterCreate::initialize(): Could not open CGEM geometry file" << endreq;
151 myNCgemLayers = myCgemGeomSvc->getNumberOfCgemLayer();
152 if(myPrintFlag) cout<<"CgemClusterCreate::initialize() "<<myNCgemLayers<<" Cgem layers"<<endl;
153 for(int i=0; i<myNCgemLayers; i++)
154 {
155 myCgemLayer[i]=myCgemGeomSvc->getCgemLayer(i);
156 myNSheets[i]=myCgemLayer[i]->getNumberOfSheet();
157 bool IsReverse = myCgemLayer[i]->getOrientation();
158 myRXstrips[i] = myCgemLayer[i]->getInnerROfAnodeCu2();
159 myRVstrips[i] = myCgemLayer[i]->getInnerROfAnodeCu1();
160 if(IsReverse) {
161 myRXstrips[i] = myCgemLayer[i]->getOuterROfAnodeCu2();
162 myRVstrips[i] = myCgemLayer[i]->getOuterROfAnodeCu1();
163 }
164 if(myRandomCluster>0) {
165 myNoiseRate[i]*=myCgemLayer[i]->getNumberOfChannelX();
166 cout<<"going to add toy cluster as noise with noise rate "<<myNoiseRate[i]<<" for CGEM layer "<<i<<endl;
167 }
168 if(myPrintFlag) cout<<"layer "<<i<<": "<<myNSheets[i]<<" sheets"<<", is reversed "<<IsReverse<<", RX="<<myRXstrips[i]<<", RY="<<myRVstrips[i]<<endl;
169 }
170
171 sc = service("CgemGeomSvc", m_SvcCgem);
172 if(sc != StatusCode::SUCCESS) {
173 log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
174 return StatusCode::FAILURE;
175 }
176
177 anode = m_SvcCgem->getReadoutPlane(0, 0);
178 anode_mid_gap_radius[0] = anode->getMidRAtGap();
179 anode = m_SvcCgem->getReadoutPlane(1, 0);
180 anode_mid_gap_radius[1] = anode->getMidRAtGap();
181 anode = m_SvcCgem->getReadoutPlane(2, 0);
182 anode_mid_gap_radius[2] = anode->getMidRAtGap();
183
184
185 // --- get CgemCalibFunSvc ---
186 sc = service ("CgemCalibFunSvc", myCgemCalibSvc);
187 if ( sc.isFailure() ){
188 cout<< name() << "Could not load MdcCalibFunSvc!" << endl;
189 return sc;
190 }
191 //cout<<"sigma from CgemCalibFunSvc: "<<myCgemCalibSvc->getSigma(0,0,0,0,0,0)<<endl;
192
193
194 // LUT
195 lutreader = new CgemLUTReader(m_LUTfile);
196 lutreader->ReadLUT();
197
198 return StatusCode::SUCCESS;
199}
INTupleSvc * ntupleSvc()
double getOuterROfAnodeCu1() const
double getInnerROfAnodeCu1() const
int getNumberOfSheet() const
int getNumberOfChannelX() const
bool getOrientation() const
double getOuterROfAnodeCu2() const
double getInnerROfAnodeCu2() const
CgemGeoLayer * getCgemLayer(int i) const
Definition CgemGeomSvc.h:48
int getNumberOfCgemLayer() const
Definition CgemGeomSvc.h:45
virtual BesTimer * addItem(const std::string &name)=0
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0

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