CGEM BOSS 6.6.5.g
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 36 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
89
90 if(myMethod==0) reset();
91 else if(myMethod==1||myMethod==3) resetFiredStripMap();
92
93 m_totEvt = 0;
94}

◆ ~CgemClusterCreate()

CgemClusterCreate::~CgemClusterCreate ( )

Definition at line 96 of file CgemClusterCreate.cxx.

97{
98 delete lutreader;
99}

Member Function Documentation

◆ execute()

StatusCode CgemClusterCreate::execute ( )

Definition at line 172 of file CgemClusterCreate.cxx.

173{
174 MsgStream log(msgSvc(), name());
175 log << MSG::INFO << "in execute()" << endreq;
176
177 // check and register /Event/Recon
178 DataObject *aReconEvent;
179 eventSvc()->findObject("/Event/Recon",aReconEvent);
180 if(aReconEvent==NULL) {
181 aReconEvent = new ReconEvent();
182 StatusCode sc = eventSvc()->registerObject("/Event/Recon",aReconEvent);
183 if(sc!=StatusCode::SUCCESS) {
184 log << MSG::FATAL << "Could not register ReconEvent" <<endreq;
185 return( StatusCode::FAILURE);
186 }
187 }
188
189
190 if(myMethod==0) method0();
191 else if(myMethod==1) method1();
192 else if(myMethod==2) toyCluster();
193 else if(myMethod==3) method2();
194 m_totEvt++;
195
196 return StatusCode::SUCCESS;
197}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode CgemClusterCreate::finalize ( )

Definition at line 1939 of file CgemClusterCreate.cxx.

1940{
1941 MsgStream log(msgSvc(),name());
1942 log << MSG::INFO << "in finalize(): Number of events in CgemClusterCreate" << m_totEvt << endreq;
1943 //delete myNTupleHelper;
1944
1945 return StatusCode::SUCCESS;
1946}

◆ initialize()

StatusCode CgemClusterCreate::initialize ( )

Definition at line 101 of file CgemClusterCreate.cxx.

102{
103 MsgStream log(msgSvc(), name());
104 log << MSG::INFO << "in initialize()" << endreq;
105
106 //CgemGeomSvc//
107 // StatusCode sc;
108 // ICgemGeomSvc* ISvcCgem;
109 // sc = service("CgemGeomSvc", ISvcCgem);
110 // if(sc != StatusCode::SUCCESS)
111 // {
112 // log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
113 // return StatusCode::FAILURE;
114 // }
115
116 //BesTimerSvc//
117 StatusCode tsc;
118 IBesTimerSvc* m_timersvc;
119 tsc = service( "BesTimerSvc", m_timersvc);
120 if( tsc.isFailure() )
121 {
122 log << MSG::WARNING << name() << " Unable to locate BesTimerSvc" << endreq;
123 return StatusCode::FAILURE;
124 }
125 m_timer = m_timersvc->addItem("Execution");
126
127 if(myNtuple) myNTupleHelper=new NTupleHelper(ntupleSvc()->book("RecCgem/CgemCluster",CLID_ColumnWiseTuple,"CgemCluster"));
128
129 if(myMethod==0||myMethod==2) {
130 if(myNtuple) hist_def();
131 }
132
133 // --- get CgemGeomSvc ---
134 ISvcLocator* svcLocator = Gaudi::svcLocator();
135 ICgemGeomSvc* ISvc;
136 StatusCode sc=svcLocator->service("CgemGeomSvc", ISvc);
137 myCgemGeomSvc=dynamic_cast<CgemGeomSvc *>(ISvc);
138 //StatusCode sc = service( "CgemGeomSvc", myCgemGeomSvc);
139 if (!sc.isSuccess()) log<< MSG::INFO << "CgemClusterCreate::initialize(): Could not open CGEM geometry file" << endreq;
140 myNCgemLayers = myCgemGeomSvc->getNumberOfCgemLayer();
141 if(myPrintFlag) cout<<"CgemClusterCreate::initialize() "<<myNCgemLayers<<" Cgem layers"<<endl;
142 for(int i=0; i<myNCgemLayers; i++)
143 {
144 myCgemLayer[i]=myCgemGeomSvc->getCgemLayer(i);
145 myNSheets[i]=myCgemLayer[i]->getNumberOfSheet();
146 bool IsReverse = myCgemLayer[i]->getOrientation();
147 myRXstrips[i] = myCgemLayer[i]->getInnerROfAnodeCu2();
148 myRVstrips[i] = myCgemLayer[i]->getInnerROfAnodeCu1();
149 if(IsReverse) {
150 myRXstrips[i] = myCgemLayer[i]->getOuterROfAnodeCu2();
151 myRVstrips[i] = myCgemLayer[i]->getOuterROfAnodeCu1();
152 }
153 if(myPrintFlag) cout<<"layer "<<i<<": "<<myNSheets[i]<<" sheets"<<", is reversed "<<IsReverse<<", RX="<<myRXstrips[i]<<", RY="<<myRVstrips[i]<<endl;
154 }
155
156 // --- get CgemCalibFunSvc ---
157 sc = service ("CgemCalibFunSvc", myCgemCalibSvc);
158 if ( sc.isFailure() ){
159 cout<< name() << "Could not load MdcCalibFunSvc!" << endl;
160 return sc;
161 }
162 //cout<<"sigma from CgemCalibFunSvc: "<<myCgemCalibSvc->getSigma(0,0,0,0,0,0)<<endl;
163
164
165 // LUT
166 lutreader = new CgemLUTReader(m_LUTfile);
167 lutreader->ReadLUT();
168
169 return StatusCode::SUCCESS;
170}
INTupleSvc * ntupleSvc()
double getOuterROfAnodeCu1() const
Definition: CgemGeoLayer.h:164
double getInnerROfAnodeCu1() const
Definition: CgemGeoLayer.h:163
int getNumberOfSheet() const
Definition: CgemGeoLayer.h:215
bool getOrientation() const
Definition: CgemGeoLayer.h:27
double getOuterROfAnodeCu2() const
Definition: CgemGeoLayer.h:168
double getInnerROfAnodeCu2() const
Definition: CgemGeoLayer.h:167
CgemGeoLayer * getCgemLayer(int i) const
Definition: CgemGeomSvc.h:48
int getNumberOfCgemLayer() const
Definition: CgemGeomSvc.h:45
virtual BesTimer * addItem(const std::string &name)=0

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