CGEM BOSS 6.6.5.f
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 ()
 
 CgemClusterCreate (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~CgemClusterCreate ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Constructor & Destructor Documentation

◆ CgemClusterCreate() [1/2]

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
88
89 if(myMethod==0) reset();
90 else if(myMethod==1||myMethod==3) resetFiredStripMap();
91
92 m_totEvt = 0;
93}

◆ ~CgemClusterCreate() [1/2]

CgemClusterCreate::~CgemClusterCreate ( )

Definition at line 95 of file CgemClusterCreate.cxx.

96{
97}

◆ CgemClusterCreate() [2/2]

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

◆ ~CgemClusterCreate() [2/2]

CgemClusterCreate::~CgemClusterCreate ( )

Member Function Documentation

◆ execute() [1/2]

StatusCode CgemClusterCreate::execute ( )

Definition at line 165 of file CgemClusterCreate.cxx.

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

◆ execute() [2/2]

StatusCode CgemClusterCreate::execute ( )

◆ finalize() [1/2]

StatusCode CgemClusterCreate::finalize ( )

Definition at line 1926 of file CgemClusterCreate.cxx.

1927{
1928 MsgStream log(msgSvc(),name());
1929 log << MSG::INFO << "in finalize(): Number of events in CgemClusterCreate" << m_totEvt << endreq;
1930 //delete myNTupleHelper;
1931
1932 return StatusCode::SUCCESS;
1933}

◆ finalize() [2/2]

StatusCode CgemClusterCreate::finalize ( )

◆ initialize() [1/2]

StatusCode CgemClusterCreate::initialize ( )

Definition at line 99 of file CgemClusterCreate.cxx.

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

◆ initialize() [2/2]

StatusCode CgemClusterCreate::initialize ( )

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