28 #ifndef ROOT_TGeoManager
29 #include "TGeoManager.h"
31 #ifndef ROOT_TGeoTrack
32 #include "TGeoTrack.h"
50 void EPTracking(
const char *input, UInt_t mult = 1, UInt_t MaxEvents = 1000000)
52 const Int_t window = 2;
56 if ( tracker == NULL ) {
57 cout <<
" Cannot run, unknown GammaTracker " <<
TRACKERNAME <<
endl;
return;
64 const int BINRANGE = 2000;
const Stat_t MINX = 0.;
const Stat_t MAXX = 2000.;
66 TH1F *hinput =
new TH1F(
"Input",
"From Geant",BINRANGE,MINX,MAXX);
67 TH1F *houtput =
new TH1F(
"Output",
"After Tracking",BINRANGE,MINX,MAXX);
69 TH1F *ep =
new TH1F(
"PhotopeakEfficiency",
"PhotopeakEfficiency",BINRANGE,MINX,MAXX);
80 for (UInt_t i = 0; i < reader.
NbEmitted(); i++ ) {
86 for (UInt_t i = 0; i < tracker->GetOutputN(); i++ ) {
87 houtput->Fill(tracker->GetEnerFactor()*tracker->GetOutputE()[i]);
96 for(Int_t i = 0 ; i < BINRANGE ; i++ ){
97 if ( hinput->GetBinContent(i+1) > 1 ) {
98 Stat_t peak = houtput->Integral(i+1-window,i+1+window) -
99 0.5*(houtput->Integral(i-2*window,i-window)+houtput->Integral(i+window,i+2*window));
101 ep->SetBinContent(i+1,peak/hinput->GetBinContent(i+1));
115 void GGTracking(
const char *input, UInt_t mult = 1, UInt_t MaxEvents = 1000000)
119 if ( tracker == NULL ) {
120 cout <<
" Cannot run, unknown GammaTracker " <<
TRACKERNAME <<
endl;
return;
128 const int BINRANGE = 2000;
const Stat_t MINX = 0.;
const Stat_t MAXX = 2000.;
129 TH2F *matrix =
new TH2F(
"GxG",
"Gamma-Gamma Matrix",BINRANGE, MINX, MAXX, BINRANGE, MINX, MAXX);
142 tracker->
DoTracking();
if ( tracker->GetOutputN() < 2 )
continue;
144 for (UInt_t i = 0; i < tracker->GetOutputN(); i++ ) {
145 Float_t ecos1 = TMath::Cos(tracker->GetOutputTheta1()[i]);
146 Float_t edop1 = (tracker->GetEnerFactor()*tracker->GetOutputE()[i])
147 / ( 1 + reader.GetRecoilBeta() * ecos1 ) ;
149 for (UInt_t j = i+1; j < tracker->GetOutputN(); j++ ) {
151 Float_t ecos2 = TMath::Cos(tracker->GetOutputTheta1()[j]);
152 Float_t edop2 = (tracker->GetEnerFactor()*tracker->GetOutputE()[j])
153 / ( 1 + reader.GetRecoilBeta() * ecos2 ) ;
155 matrix->Fill(edop1,edop2); matrix->Fill(edop2,edop1);
169 TGeoManager *geom =
new TGeoManager(
"Agata",
"AGATA");
170 TGeoMaterial *mat =
new TGeoMaterial(
"Vacuum",0,0,0); TGeoMedium *med =
new TGeoMedium(
"Vacuum",1,mat);
172 TGeoVolume *top = gGeoManager->MakeBox(
"World",med,100,100,100); gGeoManager->SetTopVolume(top);
178 geom->CloseGeometry();
186 void VisuTrack(
const char *input, UInt_t mult = 1, UInt_t MaxEvents = 10)
189 TGeoManager *geom =
new TGeoManager(
"Agata",
"AGATA");
190 TGeoMaterial *mat =
new TGeoMaterial(
"Vacuum",0,0,0); TGeoMedium *med =
new TGeoMedium(
"Vacuum",1,mat);
192 TGeoVolume *top = gGeoManager->MakeBox(
"World",med,100,100,100); gGeoManager->SetTopVolume(top);
198 geom->CloseGeometry();
208 progress++;
if ( reader.
NbImpacts() < 1 )
continue;
210 Int_t trackid = geom->AddTrack(Int_t(progress.
GetCurrentPosition()),22); TVirtualGeoTrack *primary = geom->GetTrack(trackid);
212 primary->AddPoint(0,0,0,0);
213 for( UInt_t i = 0; i < reader.
NbImpacts() ; i++ ){
214 primary->AddPoint(reader.
GetPx()[i]/10,reader.
GetPy()[i]/10,reader.
GetPz()[i]/10,0);
219 geom->GetTopVolume()->Draw(
"ogl");
Base class to build tracker families.
void AddFile(const char *fname)
to add an input file
virtual Double_t GetCurrentPosition() const
to get the current event number
GeantLMOF & fastout(GeantLMOF &reader)
virtual Int_t DoTracking()
to track the gamma-rays
Bool_t NextEvent(UInt_t mult=kMaxUInt)
To load the next event.
void VisuTrack(const char *input, UInt_t mult=1, UInt_t MaxEvents=10)
static GammaTracker * GetTracker(const char *classname)
Interface to get a new tracker.
Double_t GetEnerFactor() const
virtual bool IsFinished() const
to get the current event number
void GGTracking(const char *input, UInt_t mult=1, UInt_t MaxEvents=1000000)
This function built a gamma gamma matrix.
void ShowCurrentConditions()
The current status is shown on the standard ouptut.
static TGeoVolume * ImportAgataG4(const char *asolid="asolid", const char *aclust="aclust", const char *aeuler="aeuler", const char *top="World")
to import the agata geometry from the Agata-Geant4 world
const std::vector< Double_t > & GetPz()
const std::vector< Double_t > & GetPx()
const std::vector< Double_t > & GetEnergy()
void EPTracking(const char *input, UInt_t mult=1, UInt_t MaxEvents=1000000)
This function computes the photopeak efficiency for a given multipliciy.
Class to display a progress bar on the command line.
Class to read/decode Geant List Mode Output Files.
ADF::LogMessage & endl(ADF::LogMessage &log)
const std::vector< Double_t > & GetPy()