13 #include "PndLmdMCPoint.h"
15 #include "PndLmdStrips.h"
16 #include "PndLmdGeoHandling.h"
18 #include "TGeoManager.h"
20 #include "FairRuntimeDb.h"
21 #include "FairGeoNode.h"
22 #include "FairGeoVector.h"
24 #include "FairParamList.h"
25 #include "FairRootManager.h"
27 #include "TClonesArray.h"
41 :FairTask(
"Pnd LMD Digi Producer")
49 :FairTask(
"Pnd LMD Digi Producer")
64 FairRun* ana = FairRun::Instance();
65 FairRuntimeDb*
rtdb = ana->GetRuntimeDb();
81 FairRun* ana = FairRun::Instance();
82 FairRootManager* ioman = FairRootManager::Instance();
88 std::cout<<
"-E- PndLmdDigiProducer::Init :"
89 <<
" The FariRootManager is not initialized!"<<std::endl;
97 std::cout<<
"-E- PndLmdDigiProducer::Init :"
98 <<
"No PndLmdMCPoint Array"<<std::endl;
103 fStripArray =
new TClonesArray(
"PndLmdDigiStrips");
104 ioman->Register(
"LMDStripDigis",
"LMD",
fStripArray,kTRUE);
108 std::cout<<
"-E- PndLmdDigiProducer::DigiParTrap Container doesn't exist!"<<std::endl;
115 cout<<
"the digi paras for left segment!"<<endl;
119 cout<<
"the digi paras for right segment!"<<endl;
122 std::cout<<
"the PndLmdDigiProcuder initialized successfully!"<<std::endl;
133 PndLmdMCPoint*
point = NULL;
137 std::cout<<
"the Nr of points is"<<nPoints<<std::endl;
142 for(Int_t iPoint = 0;iPoint<nPoints;iPoint++)
146 std::cout<<
"No point !"<<std::endl;
155 TVector3 posInL =
fGeoH->MasterToLocalId(point->GetEntryPoint(),point->GetDetName());
156 TVector3 posOutL =
fGeoH->MasterToLocalId(point->GetExitPoint(),point->GetDetName());
159 std::cout<<
"the Entry point in local coordinate is "<<posInL.X()<<
","<<posInL.Y()<<
","<<posInL.Z()<<std::endl;
160 std::cout<<
"the Exit point in local coordinate is "<<posOutL.X()<<
","<<posOutL.Y()<<
","<<posOutL.Z()<<std::endl;
162 Double_t eLoss = point->GetEnergyLoss();
163 std::cout<<
"the eLoss of this point is: "<<eLoss<<endl;
165 TVector3
pos,pos1 = posInL + posOutL;
166 pos.SetXYZ(pos1.X()/2.,pos1.Y()/2.,pos1.Z()/2.);
173 std::vector<PndLmdStrips> leftStrips =
175 posOutL.X(),posOutL.Y(),posOutL.Z(),
177 if(leftStrips.size()!=0){
178 for(std::vector<PndLmdStrips>::const_iterator kit=leftStrips.begin();kit!=leftStrips.end();++kit)
180 AddDigi(iStrip,iPoint,kLMDHitsStrip,point->GetDetName(),
187 cout<<
"the iPoint is: "<<iPoint<<endl;
188 cout<<
"the iStrip is :"<<iStrip-1<<endl;
189 cout<<
"the channel is :"<<chan1<<endl;
190 cout<<
"the information of digis: "<<point->GetDetName()<<
","<<kit->GetCharge()<<endl;
194 }
else std::cout<<
"the left segment is empty"<<std::endl;
197 std::vector<PndLmdStrips> rightStrips =
199 posOutL.X(),posOutL.Y(),posOutL.Z(),
203 if(rightStrips.size()!=0){
204 for(std::vector<PndLmdStrips>::const_iterator kit=rightStrips.begin();
205 kit!=rightStrips.end();++kit){
207 AddDigi(iStrip,iPoint,kLMDHitsStrip,point->GetDetName(),
222 cout<<
"the iPoint is: "<<iPoint<<endl;
223 cout<<
"the iStrip is :"<<iStrip-1<<endl;
224 cout<<
"the channel is :"<<chan2<<endl;
225 cout<<
"the information of digis: "<<point->GetDetName()<<
","<<kit->GetCharge()<<endl;
229 }
else std::cout<<
"the right segment is empty"<<std::endl;
236 std::cout<<
"-I- PndLmdDigiProducer: "<<nPoints<<
" PndLmdMCPoint, "
237 <<iStrip<<
" PndLmdDigis"<<std::endl<<std::endl;
246 for(Int_t skr=0;skr<iStrip && found==kFALSE;skr++){
260 new((*fStripArray)[iStrip])
PndLmdDigiStrips(iPoint,detID,detName,fe,channel,charge);
virtual void Exec(Option_t *opt)
PndLmdCalStrip * fCurrentStripCalLeft
PndLmdDigiPara * fCurrentDigiPar
std::vector< PndLmdStrips > DigiStripFromPoint(Double_t inx, Double_t iny, Double_t inz, Double_t outx, Double_t outy, Double_t outz, Double_t eloss)
TClonesArray * fPointArray
virtual InitStatus Init()
PndLmdGeoHandling * fGeoH
TGeoManager * gGeoManager
TString GetDetName() const
ClassImp(PndLmdDigiProducer)
void AddDigi(Int_t &iStrip, Int_t iPoint, Int_t detID, TString detName, Int_t fe, Int_t channel, Double_t charge)
PndLmdCalStrip * fCurrentStripCalRight
Int_t CalFeFromStrip(Int_t stripNr)
PndLmdDigiPara * fDigiParTrap
PndLmdCalStrip * fStripCalTrapLeft
virtual void SetParContainers()
Int_t GetNrFeChannels() const
Int_t CalChannelFromStrip(Int_t stripNr)
Int_t GetNrLeftFe() const
TClonesArray * fStripArray
PndLmdCalStrip * fStripCalTrapRight
virtual InitStatus ReInit()