7 #include "TClonesArray.h"
8 #include "TParticlePDG.h"
13 #include "FairRootManager.h"
15 #include "FairRuntimeDb.h"
28 fHitBranch(
"MVDHitsPixel"),
29 fHitBranch2(
"MVDHitsStrip"),
30 fMCTrackBranch(
"MCTrack"),
31 fTrackBranch(
"MVDIdealTrackCand"),
39 fTrackCandArray(NULL),
57 for(
int j=0;j<
fNTh;j++){
68 fCutDistH->GetXaxis()->SetTitle(
"Pt, GeV/c");
70 fCutChi2H->GetXaxis()->SetTitle(
"Pt, GeV/c");
85 InitStatus stat=kSUCCESS;
93 FairRootManager* ioman = FairRootManager::Instance();
97 std::cout <<
"-E- PndMvdRiemannTrackFinderTaskCutPar::Init: "
98 <<
"RootManager not instantiated!" << std::endl;
105 std::cout <<
"-W- PndMvdRiemannTrackFinderTaskCutPar::Init: " <<
"No hitArray!" << std::endl;
111 std::cout <<
"-W- PndMvdRiemannTrackFinderTaskCutPar::Init: " <<
"No hitArray2!" << std::endl;
119 std::cout <<
"-W- PndMvdRiemannTrackFinderTaskCutPar::Init: " <<
"No IdealTrackCands!" << std::endl;
125 std::cout <<
"-W- PndMvdRiemannTrackFinderTaskCutPar::Init: " <<
"No MCTrack!" << std::endl;
129 std::cout <<
"-I- PndMvdRiemannTrackFinderTaskCutPar: Initialisation successfull" << std::endl;
139 Fatal(
"Exec",
"No trackCandArray");
144 std::cout <<
"Done event no. " <<
fEventNr++ << std::endl;
167 unsigned int detId,hitId;
170 if ((
int)detId==FairRootManager::Instance()->GetBranchId(
fHitBranch)){
176 else if ((
int)detId==FairRootManager::Instance()->GetBranchId(
fHitBranch2)){
182 else {i++;std::cout<<
"ERROR"<<std::endl;
continue;};
190 for(
int k=0;k<
count;k++){
206 unsigned int detId,hitId;
209 double Pt=myTrack->
GetPt();
215 if ((
int)detId==FairRootManager::Instance()->GetBranchId(
fHitBranch)){
219 else if ((
int)detId==FairRootManager::Instance()->GetBranchId(
fHitBranch2)){
223 else {std::cout<<
"ERROR"<<std::endl;
continue;};
236 delta=hit1.
x()-hit2.
x();
246 for(
int j=0;j<
fNTh;j++){
254 for(
int k=1;k<(
fNbin/2);k++){
267 for(
int k=0;k<
fNbin;k++){
270 CutChi2=((double)k*
frangeChi2)/((double)fNbin);
279 TFile fout(
"MVDCutHists.root",
"recreate");
int fNbin
number of bins in the cut hists during calculation of the cut parameters
TClonesArray * fTrackCandArray
TH1F * fhistsDist[fNPt][fNTh]
TClonesArray * fRiemannTracks
unsigned int fNCut
cut max number of hits in IdealTrack
virtual void FinishEvent()
TVector3 GetMomentum() const
PndMvdRiemannTrackFinderTaskCutPar()
void setDXYZ(double dx, double dy, double dz)
ClassImp(PndMvdRiemannTrackFinderTaskCutPar)
virtual ~PndMvdRiemannTrackFinderTaskCutPar()
bool CheckTooCloseHits(PndRiemannHit hit1, PndRiemannHit hit2)
TClonesArray * fMCTrackArray
static const int fNTh
number of Theta bins
TH2F * fCutChi2H
output cutChi2 histogram
void setXYZ(double x, double y, double z)
TH2F * fCutDistH
output cutDist histogram
void refit(bool withErrorCalc=true)
double frangeChi2
max cutChi2
virtual InitStatus ReInit()
double frangeDist
max dist
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
virtual void SetParContainers()
virtual InitStatus Init()
const TVector3 & x() const
TClonesArray * fHitArray2
static const int fNPt
number of Pt bins
void szFit(bool withErrorCalc=true)
void addHit(PndRiemannHit &hit)
virtual void Exec(Option_t *opt)
TH1F * fhistsChi2[fNPt][fNTh]
Int_t GetMotherID() const