14 #include "FairRootManager.h"
18 #include "FairRunAna.h"
19 #include "FairRuntimeDb.h"
20 #include "FairBaseParSet.h"
21 #include "FairGeoVolume.h"
23 #include "FairGeoTransform.h"
24 #include "FairGeoVector.h"
25 #include "FairGeoMedium.h"
26 #include "FairGeoNode.h"
29 #include "TParticlePDG.h"
30 #include "TDatabasePDG.h"
32 #include "TGeoManager.h"
41 :FairTask(
"PndPhoGunShort")
50 :FairTask(
"PndPhoGunShort")
68 cout <<
" ---------- INITIALIZATION ------------" << endl;
71 FairRootManager* ioman = FairRootManager::Instance();
73 cout <<
"-E- PndPhoGunShort::Init: "
74 <<
"RootManager not instantiated!" << endl;
79 fMCArray = (TClonesArray*) ioman->GetObject(
"MCTrack");
81 cout <<
"-W- PndPhoGunShort::Init: "
82 <<
"No MCTrack array!" << endl;
86 fPDPointArray = (TClonesArray*) ioman->GetObject(
"DrcPDPoint");
88 cout <<
"-W- PndPhoGunShort::Init: "
89 <<
"No DrcPDPoint array!" << endl;
93 fPDHitArray = (TClonesArray*) ioman->GetObject(
"DrcPDHit");
95 cout <<
"-W- PndPhoGunShort::Init: "
96 <<
"No DrcPDHit array!" << endl;
100 fEVPointArray = (TClonesArray*) ioman->GetObject(
"DrcEVPoint");
102 cout <<
"-W- PndPhoGunShort::Init: "
103 <<
"No DrcEVPoint array!" << endl;
108 cout <<
"-W- PndDrcLogLikeli::Init: "
109 <<
"No DrcBarPoint array!" << endl;
112 fDigiArray = (TClonesArray*) ioman->GetObject(
"DrcDigi");
114 cout <<
"-W- PndPhoGunShortP::Init: " <<
"No DrcDigi array!" << endl;
145 cout<<
"shifted pixels"<<endl;
163 fTree =
new TTree(
"dircsim",
"Look-up table for DIRC");
164 for(Int_t iLut=0; iLut<5; iLut++){
165 fLut[iLut] =
new TClonesArray(
"PndDrcLutNode");
166 fTree->Branch(Form(
"LUT%d",iLut),&
fLut[iLut],256000,0);
180 cout <<
"-I- PndPhoGunShort: Intialization successfull" << endl;
192 cout<<
"Event # "<<
nevents<<endl;
200 Int_t SelectionName=0;
206 for(Int_t k=0; k<
fPDHitArray->GetEntriesFast(); k++) {
215 Int_t trID=
Ppt->GetTrackID();
220 if(trID!=
EVpt->GetTrackID())cout<<
"different track IDs"<<endl;
222 if(trID!=
EVpt->GetTrackID())
continue;
237 for(Int_t k2 = 1; k2 <
fEVPointArray->GetEntriesFast()-1; k2++){
244 if(wePho == kTRUE)
continue;
254 for(Int_t k1 = 1; k1 < EVEntry; k1++){
275 if(EVEntry>=6)
ReflName.Append(
"XX");
276 ReflName.Prepend(Form(
"%d",PhiSec));
305 if(SelectionName==0.){
continue;}
411 if(startPhi < 0.){startPhi = 360. + startPhi;}
412 if(startPhi > 0. && startPhi < 90.){
415 if(startPhi > 90. && startPhi < 270.){
418 if(startPhi > 270. && startPhi < 360.){
425 TVector3 ver1, ver2, ver3, ver4;
431 ver1.RotateZ(PhiRot/180.*
fpi);
432 ver2.RotateZ(PhiRot/180.*
fpi);
433 ver3.RotateZ(PhiRot/180.*
fpi);
434 ver4.RotateZ(PhiRot/180.*
fpi);
441 return PhiRot/180.*
fpi;
446 Int_t Nnodes = 30000;
447 for(Int_t iLut=0; iLut<5; iLut++){
448 TClonesArray &fLuta = *
fLut[iLut];
449 for (Long64_t
n=0;
n<Nnodes;
n++) {
462 for(Int_t iLut=0; iLut<5; iLut++){
465 cout <<
"-I- PndDrcLutFill: Finish" << endl;
TClonesArray * fBarPointArray
friend F32vec4 cos(const F32vec4 &a)
virtual ~PndPhoGunShort()
virtual InitStatus Init()
virtual void SetParContainers()
friend F32vec4 sin(const F32vec4 &a)
TVector3 GetMomentum() const
TClonesArray * fPDPointArray
PndGeoDrc * fGeo
Basic geometry data of barrel DRC.
cout<< "blue = Monte Carlo "<< endl;cout<< "red = Helix Hit "<< endl;cout<< "green = Center Of Tubes "<< endl;for(Int_t k=0;k< track->GetEntriesFast();k++){PndSttTrack *stttrack=(PndSttTrack *) track-> At(k)
TClonesArray * fPDHitArray
Int_t GetBarPointID() const
virtual Int_t GetRefIndex()
Double_t InBarCoordSyst(TVector3, TVector3 *, TVector3 *, TVector3 *, TVector3 *)
TClonesArray * fDigiArray
friend F32vec4 fabs(const F32vec4 &a)
static PndGeoHandling * Instance()
TVector3 GetPosition() const
TClonesArray * fEVPointArray
Int_t GetSensorId() const
TVector3 GetStartVertex() const
Int_t GetDetectorId() const
Double_t FindReflectionType(Double_t, Double_t, Double_t, TString)
Int_t GetIndex(int i=0) const
TMatrixT< double > TMatrixD
virtual void Exec(Option_t *option)