]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HMPID/AliHMPID.cxx
use eta-phi cuts instead of R-z cuts for track matching, add track momentum cut ...
[u/mrichter/AliRoot.git] / HMPID / AliHMPID.cxx
CommitLineData
d3da6dc4 1// **************************************************************************
2// * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3// * *
4// * Author: The ALICE Off-line Project. *
5// * Contributors are mentioned in the code where appropriate. *
6// * *
7// * Permission to use, copy, modify and distribute this software and its *
8// * documentation strictly for non-commercial purposes is hereby granted *
9// * without fee, provided that the above copyright notice appears in all *
10// * copies and that both the copyright notice and this permission notice *
11// * appear in the supporting documentation. The authors make no claims *
12// * about the suitability of this software for any purpose. It is *
13// * provided "as is" without express or implied warranty. *
14// **************************************************************************
15
c93255fe 16#include <TTree.h>
d3da6dc4 17#include "AliHMPID.h"
18#include "AliHMPIDHit.h" //OccupancyPrint(), HitQa()
3c6274c1 19#include "AliHMPIDDigit.h" //
d3da6dc4 20#include <TParticle.h> //SummaryOfEvent(), HitQa()
21#include <TBenchmark.h> //HitQA()
22#include <TPDGCode.h> //HitQA()
3c6274c1 23#include <AliStack.h> //SummaryOfEvent(), HitQa()
d3da6dc4 24#include <AliRun.h> //HitQa()
25#include <AliMC.h> //ctor
26#include <AliHeader.h>
d3da6dc4 27#include <TH1F.h> //HitQA()
28#include <AliLog.h> //in many methods to print AliInfo
c93255fe 29#include "AliLoader.h"
27311693 30
d3da6dc4 31ClassImp(AliHMPID)
32//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
59d9d4b3 33AliHMPID::AliHMPID(const char *name, const char *title):AliDetector(name,title),fDoFeed(kTRUE),fSdi(0),fDig(0),fClu(0)
d3da6dc4 34{
35//Named ctor
36 AliDebug(1,"Start.");
37//AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them)
38 HitCreate(); gAlice->GetMCApp()->AddHitList(fHits);
59d9d4b3 39
40 TString ttl=title;
41 fDoFeed=!ttl.Contains("NoFeedBack");
d3da6dc4 42 AliDebug(1,"Stop.");
43}//AliHMPID::AliHMPID(const char *name, const char *title)
44//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45AliHMPID::~AliHMPID()
46{
47//dtor
48 AliDebug(1,"Start.");
49
50
51 if(fHits) delete fHits;
52 if(fDigits) delete fDigits;
53 if(fSdi) delete fSdi;
54 if(fDig) {fDig->Delete(); delete fDig;}
55 if(fClu) {fClu->Delete(); delete fClu;}
56 AliDebug(1,"Stop.");
57}//AliHMPID::~AliHMPID()
58//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
59void AliHMPID::MakeBranch(Option_t* option)
60{
61//Create Tree branches for the HMPID.
62 AliDebug(1,Form("Start with option= %s.",option));
63
64 const Int_t kBufSize = 4000;
65
66 const char *cH = strstr(option,"H");
67 const char *cD = strstr(option,"D");
68 const char *cR = strstr(option,"R");
69 const char *cS = strstr(option,"S");
70
cb5b8b21 71 if(cH&&fLoader->TreeH()){HitCreate(); MakeBranchInTree(fLoader->TreeH(), "HMPID" ,&fHits ,kBufSize,0);}
d3da6dc4 72 if(cS&&fLoader->TreeS()){SdiCreate(); MakeBranchInTree(fLoader->TreeS(), "HMPID" ,&fSdi ,kBufSize,0);}
73 if(cD&&fLoader->TreeD()){DigCreate();for(Int_t i=0;i<7;i++) MakeBranchInTree(fLoader->TreeD(),Form("HMPID%d",i),&((*fDig)[i]),kBufSize,0);}
74 if(cR&&fLoader->TreeR()){CluCreate();for(Int_t i=0;i<7;i++) MakeBranchInTree(fLoader->TreeR(),Form("HMPID%d",i),&((*fClu)[i]),kBufSize,0);}
75
76 AliDebug(1,"Stop.");
77}//void AliHMPID::MakeBranch(Option_t* option)
78//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79void AliHMPID::SetTreeAddress()
80{
81//Set branch address for the Hits and Digits Tree.
82 AliDebug(1,"Start.");
83 if(fLoader->TreeH() && fLoader->TreeH()->GetBranch("HMPID" )){HitCreate(); fLoader->TreeH()->SetBranchAddress( "HMPID" ,&fHits );}
84 if(fLoader->TreeS() && fLoader->TreeS()->GetBranch("HMPID" )){SdiCreate(); fLoader->TreeS()->SetBranchAddress( "HMPID" ,&fSdi );}
85 if(fLoader->TreeD() && fLoader->TreeD()->GetBranch("HMPID0")){DigCreate(); for(int i=0;i<7;i++) fLoader->TreeD()->SetBranchAddress(Form("HMPID%d",i),&((*fDig)[i]));}
86 if(fLoader->TreeR() && fLoader->TreeR()->GetBranch("HMPID0")){CluCreate(); for(int i=0;i<7;i++) fLoader->TreeR()->SetBranchAddress(Form("HMPID%d",i),&((*fClu)[i]));}
87 AliDebug(1,"Stop.");
88}//void AliHMPID::SetTreeAddress()
89//__________________________________________________________________________________________________
90// AliHMPIDHit* AliHMPID::Hit(Int_t tid)const
91// {
92// // Search for the first HMPID hit belonging to the given tid
93// GetLoader()->LoadHits();
94// for(Int_t iPrimN=0;iPrimN<GetLoader()->TreeH()->GetEntries();iPrimN++){//prims loop
95// GetLoader()->TreeH()->GetEntry(iPrimN);
96// for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){
97// AliHMPIDHit *pHit=(AliHMPIDHit*)Hits()->At(iHitN);
98// if(tid==pHit->Track()) {GetLoader()->UnloadHits();return pHit;}
99// }//hits
100// }//prims loop
101// GetLoader()->UnloadHits();
102// return 0;
103// }