// //
///////////////////////////////////////////////////////////////////////////////
-#include <assert.h>
-
#include <TBrowser.h>
-#include <TFile.h>
-#include <TFolder.h>
-#include <TROOT.h>
#include <TTree.h>
-#include <Riostream.h>
#include "AliConfig.h"
#include "AliDetector.h"
#include "AliMC.h"
-// Static variables for the hit iterator routines
-static Int_t sMaxIterHit=0;
-static Int_t sCurIterHit=0;
-
-
ClassImp(AliDetector)
//_______________________________________________________________________
}
//_______________________________________________________________________
-void AliDetector::Publish(const char */*dir*/, void */*address*/, const char */*name*/)
+void AliDetector::Publish(const char */*dir*/, void */*address*/, const char */*name*/) const
{
//
// Register pointer to detector objects.
//
-// TFolder *topFolder = (TFolder *)gROOT->FindObjectAny("/Folders");
MayNotUse("Publish");
}
TreeH()->GetEvent(track); //skowron
}
//
- sMaxIterHit=fHits->GetEntriesFast();
- sCurIterHit=0;
- if(sMaxIterHit) return dynamic_cast<AliHit*>(fHits->UncheckedAt(0));
+ fMaxIterHit=fHits->GetEntriesFast();
+ fCurIterHit=0;
+ if(fMaxIterHit) return dynamic_cast<AliHit*>(fHits->UncheckedAt(0));
else return 0;
}
//
// Return the next hit for the current track
//
- if(sMaxIterHit) {
- if(++sCurIterHit<sMaxIterHit)
- return dynamic_cast<AliHit*>(fHits->UncheckedAt(sCurIterHit));
+ if(fMaxIterHit) {
+ if(++fCurIterHit<fMaxIterHit)
+ return dynamic_cast<AliHit*>(fHits->UncheckedAt(fCurIterHit));
else
return 0;
} else {
for (Int_t hit=0;hit<nhits;hit++) {
ahit = dynamic_cast<AliHit*>(fHits->UncheckedAt(hit));
trk=ahit->GetTrack();
- assert(trk<=tracks);
+ if(trk>tracks) Fatal("LoadPoints","Found track number %d, max track %d\n",trk, tracks);
if(ntrk[trk]==limi[trk])
{
//
}
//_______________________________________________________________________
-TTree* AliDetector::TreeH()
+TTree* AliDetector::TreeH() const
{
//Get the hits container from the folder
if (GetLoader() == 0x0)
/* $Id$ */
+//
+// This is the basic detector class from which
+// all ALICE detector derive.
+// This class is the base for the implementation of all detectors
+// in ALICE
+//
+
#include "AliModule.h"
class AliHit;
{det.Copy(*this); return (*this);}
// Other methods
- virtual void Publish(const char *dir, void *c, const char *name=0);
+ virtual void Publish(const char *dir, void *c, const char *name=0) const;
virtual void Browse(TBrowser *b);
virtual void FinishRun();
virtual void LoadPoints(Int_t track);
virtual AliLoader* MakeLoader(const char* topfoldername); //builds standard getter (AliLoader type)
void SetLoader(AliLoader* loader){fLoader = loader;}
AliLoader* GetLoader() const {return fLoader;} //skowron
- TTree* TreeH(); //shorcut method for accessing treeH from folder
+ TTree* TreeH() const; //shorcut method for accessing treeH from folder
// Data members
protected:
Int_t fNhits; //!Number of hits
Int_t fNdigits; //!Number of digits
Int_t fBufferSize; //!buffer size for Tree detector branches
+ Int_t fMaxIterHit; //!Limit for the hit iterator
+ Int_t fCurIterHit; //!Counter for the hit iterator
TClonesArray *fHits; //!List of hits for one track only
TClonesArray *fDigits; //!List of digits for this detector
TObjArray *fPoints; //!Array of points for each track (all tracks in memory)
Float_t GetTPCchi2() const {return fTPCchi2;}
Int_t GetTPCclusters(Int_t *idx) const;
Int_t GetTPCLabel() const {return fTPCLabel;}
- const TBits& GetTPCClusterMap(){return fTPCClusterMap;}
+ const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
void SetTRDpid(const Double_t *p);
void GetTRDpid(Double_t *p) const;
Float_t GetPHOSsignal() const {return fPHOSsignal;}
void GetPHOSpid(Double_t *p) const;
- Bool_t IsOn(Int_t mask){ return (fFlags&mask)>0;}
- Bool_t IsRICH(){ return fFlags&kRICHpid;}
- Bool_t IsPHOS(){ return fFlags&kPHOSpid;}
+ Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
+ Bool_t IsRICH() const {return fFlags&kRICHpid;}
+ Bool_t IsPHOS() const {return fFlags&kPHOSpid;}
enum {
kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
Double_t fRc[15]; // external cov. matrix of the track parameters
//Track parameters constrained to the primary vertex
- Double_t fCalpha,fCx,fCp[5],fCc[15];
+ Double_t fCalpha; // Track rotation angle
+ Double_t fCx; // x-coordinate of the track reference plane
+ Double_t fCp[5]; // external track parameters
+ Double_t fCc[15]; // external cov. matrix of the track parameters
Double_t fCchi2; //chi2 at the primary vertex
//Track parameters at the inner wall of the TPC
- Double_t fIalpha,fIx,fIp[5],fIc[15];
+ Double_t fIalpha; // Track rotation angle
+ Double_t fIx; // x-coordinate of the track reference plane
+ Double_t fIp[5]; // external track parameters
+ Double_t fIc[15]; // external cov. matrix of the track parameters
//Track parameters at the radius of the PHOS
- Double_t fOalpha,fOx,fOp[5],fOc[15];
+ Double_t fOalpha; // Track rotation angle
+ Double_t fOx; // x-coordinate of the track reference plane
+ Double_t fOp[5]; // external track parameters
+ Double_t fOc[15]; // external cov. matrix of the track parameters
// ITS related track information
Float_t fITSchi2; // chi2 in the ITS