#include <TSystem.h>
#include <TArrayF.h>
+#include <AliRunLoader.h>
+#include <AliHeader.h>
+#include <AliGenEventHeader.h>
+#include <AliESD.h>
+#include <AliESDHLTtrack.h>
+
#include "AliL3StandardIncludes.h"
#include "AliL3Logging.h"
#include "AliLevel3.h"
#include "AliL3Track.h"
#include "AliL3HoughTrack.h"
#include "AliL3TrackArray.h"
-#include "AliRunLoader.h"
-#include "AliHeader.h"
-#include "AliGenEventHeader.h"
-#include "AliESD.h"
-#include "AliESDHLTtrack.h"
#if __GNUC__== 3
using namespace std;
ClassImp(AliHLTReconstructor)
AliHLTReconstructor::AliHLTReconstructor(): AliReconstructor()
-{
+{
+ //constructor
AliL3Log::fgLevel=AliL3Log::kWarning;
fDoTracker=1;
fDoHough=1;
}
AliHLTReconstructor::AliHLTReconstructor(Bool_t doTracker, Bool_t doHough): AliReconstructor()
-{
+{
+ //constructor
AliL3Log::fgLevel=AliL3Log::kWarning;
fDoTracker=doTracker;
fDoHough=doHough;
}
AliHLTReconstructor::~AliHLTReconstructor()
-{
+{
+ //deconstructor
if(fDoCleanUp){
char name[256];
gSystem->Exec("rm -rf hlt");
void AliHLTReconstructor::Reconstruct(AliRunLoader* runLoader) const
{
+ // do the standard and hough reconstruction chain
if(!runLoader) {
LOG(AliL3Log::kFatal,"AliHLTReconstructor::Reconstruct","RunLoader")
<<" Missing RunLoader! 0x0"<<ENDLOG;
void AliHLTReconstructor::ReconstructWithConformalMapping(AliRunLoader* runLoader,Int_t iEvent) const
{
+ // reconstruct with conformal mapper
AliLevel3 *fHLT = new AliLevel3(runLoader);
fHLT->Init("./", AliLevel3::kRunLoader, 1);
void AliHLTReconstructor::ReconstructWithHoughTransform(AliRunLoader* runLoader,Int_t iEvent) const
{
+ //reconstruct with hough
Float_t ptmin = 0.1*AliL3Transform::GetSolenoidField();
Float_t zvertex = 0;
void AliHLTReconstructor::FillESD(AliRunLoader* runLoader,
AliESD* esd) const
{
+ //fill the esd file with found tracks
Int_t iEvent = runLoader->GetEventNumber();
if(fDoTracker) FillESDforConformalMapping(esd,iEvent);
void AliHLTReconstructor::FillESDforConformalMapping(AliESD* esd,Int_t iEvent) const
{
- //Assign MC labels for found tracks
+ //fill esd with tracks from conformal mapping
Int_t slicerange[2]={0,35};
Int_t good = (int)(0.4*AliL3Transform::GetNRows());
Int_t nclusters = (int)(0.4*AliL3Transform::GetNRows());
void AliHLTReconstructor::FillESDforHoughTransform(AliESD* esd,Int_t iEvent) const
{
+ //fill esd with tracks from hough
char filename[256];
sprintf(filename,"./hough/tracks_%d.raw",iEvent);
#ifdef use_reconstruction
#include "AliReconstructor.h"
-#include "AliL3Logging.h"
class AliHLTReconstructor: public AliReconstructor {
public:
AliL3ClustFinderNew::AliL3ClustFinderNew()
{
+ //constructor
fMatch = 1;
fThreshold = 10;
fXYErr = 0.2;
AliL3ClustFinderNew::~AliL3ClustFinderNew()
{
+ //destructor
+ ;
}
void AliL3ClustFinderNew::InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t nmaxpoints)
{
+ //init slice
fNClusters = 0;
fMaxNClusters = nmaxpoints;
fCurrentSlice = slice;
void AliL3ClustFinderNew::InitSlice(Int_t slice,Int_t patch,Int_t nmaxpoints)
{
+ //init slice
fNClusters = 0;
fMaxNClusters = nmaxpoints;
fCurrentSlice = slice;
void AliL3ClustFinderNew::SetOutputArray(AliL3SpacePointData *pt)
{
+ //set pointer to output
fSpacePointData = pt;
}
void AliL3ClustFinderNew::Read(UInt_t ndigits,AliL3DigitRowData *ptr)
{
+ //set input pointer
fNDigitRowData = ndigits;
fDigitRowData = ptr;
}
void AliL3ClustFinderNew::ProcessDigits()
{
//Loop over rows, and call processrow
-
AliL3DigitRowData *tempPt = (AliL3DigitRowData*)fDigitRowData;
for(Int_t i=fFirstRow; i<=fLastRow; i++)
void AliL3ClustFinderNew::ProcessRow(AliL3DigitRowData *tempPt)
{
-
+ //process row
UInt_t last_pad = 123456789;
- ClusterData *pad1[5000]; //2 lists for internal memory=2pads
- ClusterData *pad2[5000]; //2 lists for internal memory=2pads
- ClusterData clusterlist[10000]; //Clusterlist
+ AliClusterData *pad1[5000]; //2 lists for internal memory=2pads
+ AliClusterData *pad2[5000]; //2 lists for internal memory=2pads
+ AliClusterData clusterlist[10000]; //Clusterlist
- ClusterData **currentPt; //List of pointers to the current pad
- ClusterData **previousPt; //List of pointers to the previous pad
+ AliClusterData **currentPt; //List of pointers to the current pad
+ AliClusterData **previousPt; //List of pointers to the previous pad
currentPt = pad2;
previousPt = pad1;
UInt_t n_previous=0,n_current=0,n_total=0;
if(difference <= fMatch) //There is a match here!!
{
- ClusterData *local = previousPt[p];
+ AliClusterData *local = previousPt[p];
if(fDeconvPad)
{
//current pad will be previous pad on next pad.
//Add to the clusterlist:
- ClusterData *tmp = &clusterlist[n_total];
+ AliClusterData *tmp = &clusterlist[n_total];
tmp->fTotalCharge = seq_charge;
tmp->fPad = pad_mean;
tmp->fPad2 = pad_error;
WriteClusters(n_total,clusterlist);
}
-void AliL3ClustFinderNew::WriteClusters(Int_t n_clusters,ClusterData *list)
+void AliL3ClustFinderNew::WriteClusters(Int_t n_clusters,AliClusterData *list)
{
+ //write cluster to output pointer
Int_t thisrow,thissector;
UInt_t counter = fNClusters;
if(fCalcerr) { //calc the errors, otherwice take the fixed error
Int_t patch = AliL3Transform::GetPatch(fCurrentRow);
- Float_t sy2=(Float_t)list[j].fPad2/(Float_t)list[j].fTotalCharge - fpad*fpad;
+ Double_t sy2=(Float_t)list[j].fPad2/(Float_t)list[j].fTotalCharge - fpad*fpad;
if(sy2 < 0) {
LOG(AliL3Log::kError,"AliL3ClustFinderNew::WriteClusters","Cluster width")
<<"SigmaY2 negative "<<sy2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
}
} else fpad2=sy2; //take the width not the error
}
- Float_t sz2=(Float_t)list[j].fTime2/(Float_t)list[j].fTotalCharge - ftime*ftime;
+ Double_t sz2=(Float_t)list[j].fTime2/(Float_t)list[j].fTotalCharge - ftime*ftime;
if(sz2 < 0){
LOG(AliL3Log::kError,"AliL3ClustFinderNew::WriteClusters","Cluster width")
<<"SigmaZ2 negative "<<sz2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
#ifdef do_mc
void AliL3ClustFinderNew::GetTrackID(Int_t pad,Int_t time,Int_t *trackID)
{
+ //get mc id
AliL3DigitRowData *rowPt = (AliL3DigitRowData*)fDigitRowData;
trackID[0]=trackID[1]=trackID[2]=-2;
#include "AliL3RootTypes.h"
-struct ClusterData
+struct AliClusterData
{
UInt_t fTotalCharge;
UInt_t fPad;
UInt_t fLastCharge; //for deconvolution
UInt_t fLastMergedPad; //dont merge twice per pad
};
-typedef struct ClusterData ClusterData;
+typedef struct AliClusterData AliClusterData;
class AliL3DigitRowData;
class AliL3SpacePointData;
Bool_t fCalcerr; //calculate centroid sigmas
Bool_t fRawSP; //store centroids in raw system
- UInt_t fNDigitRowData;
- Int_t fFirstRow;
- Int_t fLastRow;
- Int_t fCurrentRow;
- Int_t fCurrentSlice;
- Int_t fCurrentPatch;
- Int_t fMatch;
- UInt_t fThreshold;
- Int_t fNClusters;
- Int_t fMaxNClusters;
- Float_t fXYErr;
- Float_t fZErr;
+ UInt_t fNDigitRowData; //ndigts on row
+ Int_t fFirstRow; //first row
+ Int_t fLastRow; //last row
+ Int_t fCurrentRow; //current active row
+ Int_t fCurrentSlice; //current slice
+ Int_t fCurrentPatch; //current patch
+ Int_t fMatch; //size of match
+ UInt_t fThreshold; //threshold for clusters
+ Int_t fNClusters; //number of found clusters
+ Int_t fMaxNClusters; //max. number of clusters
+ Float_t fXYErr; //fixed error in XY
+ Float_t fZErr; //fixed error in Z
#ifdef do_mc
void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
void ProcessDigits();
void ProcessRow(AliL3DigitRowData *tempPt);
void SetOutputArray(AliL3SpacePointData *pt);
- void WriteClusters(Int_t n_clusters,ClusterData *list);
+ void WriteClusters(Int_t n_clusters,AliClusterData *list);
void SetXYError(Float_t f) {fXYErr=f;}
void SetZError(Float_t f) {fZErr=f;}
void SetSTDOutput(Bool_t f=kFALSE) {fStdout=f;}
void SetCalcErr(Bool_t f=kTRUE) {fCalcerr=f;}
void SetRawSP(Bool_t f=kFALSE) {fRawSP=f;}
- Int_t GetNumberOfClusters() {return fNClusters;}
+ Int_t GetNumberOfClusters() const {return fNClusters;}
ClassDef(AliL3ClustFinderNew,1) //Fast cluster finder
Int_t AliL3ConfMapFit::FitHelix()
{
+ //fit the helix
if(FitCircle())
{
LOG(AliL3Log::kError,"AliL3ConfMapFit::FitHelix","TrackFit")<<AliL3Log::kDec<<
for(fTrack->StartLoop(); fTrack->LoopDone(); fTrack->GetNextHit())
{
co++;
- AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->currentHit;
+ AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->GetCurrentHit();
cHit->SetXYWeight( 1./ (Double_t)(cHit->GetXerr()*cHit->GetXerr() + cHit->GetYerr()*cHit->GetYerr()) );
wsum += cHit->GetXYWeight() ;
xav += cHit->GetXYWeight() * cHit->GetX() ;
for(fTrack->StartLoop(); fTrack->LoopDone(); fTrack->GetNextHit())
{
//AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint *)hits->At(hit_counter);
- AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->currentHit;
+ AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->GetCurrentHit();
xi = cHit->GetX() - xav ;
yi = cHit->GetY() - yav ;
xxav += xi * xi * cHit->GetXYWeight() ;
for(fTrack->StartLoop(); fTrack->LoopDone(); fTrack->GetNextHit())
{
//AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)hits->At(hit_counter);
- AliL3ConfMapPoint* cHit = (AliL3ConfMapPoint*)fTrack->currentHit;
+ AliL3ConfMapPoint* cHit = (AliL3ConfMapPoint*)fTrack->GetCurrentHit();
xold = cHit->GetX() - xav ;
yold = cHit->GetY() - yav ;
//Set the first point on the track to the space point coordinates of the innermost track
//This will be updated to lie on the fit later on (AliL3Track::UpdateToFirstPoint).
Double_t x0,y0,psi,pt ;
- AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)fTrack->lastHit;
+ AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)fTrack->GetLastHit();
x0 = lHit->GetX();
y0 = lHit->GetY();
fTrack->SetFirstPoint(x0,y0,0); //Z-value is set in FitLine
if (0)// fTrack->ComesFromMainVertex() == true )
{
- dx = ((AliL3ConfMapPoint*)fTrack->firstHit)->GetX() - fVertex->GetX();
- dy = ((AliL3ConfMapPoint*)fTrack->firstHit)->GetY() - fVertex->GetY() ;
+ dx = ((AliL3ConfMapPoint*)fTrack->GetFirstHit())->GetX() - fVertex->GetX();
+ dy = ((AliL3ConfMapPoint*)fTrack->GetFirstHit())->GetY() - fVertex->GetY() ;
}
else
{
- dx = ((AliL3ConfMapPoint *)fTrack->firstHit)->GetX() - ((AliL3ConfMapPoint *)fTrack->lastHit)->GetX() ;
- dy = ((AliL3ConfMapPoint *)fTrack->firstHit)->GetY() - ((AliL3ConfMapPoint *)fTrack->lastHit)->GetY() ;
+ dx = ((AliL3ConfMapPoint *)fTrack->GetFirstHit())->GetX() - ((AliL3ConfMapPoint *)fTrack->GetLastHit())->GetX() ;
+ dy = ((AliL3ConfMapPoint *)fTrack->GetFirstHit())->GetY() - ((AliL3ConfMapPoint *)fTrack->GetLastHit())->GetY() ;
//dx = ((AliL3ConfMapPoint *)hits->First())->GetX() - ((AliL3ConfMapPoint *)hits->Last())->GetX() ;
//dy = ((AliL3ConfMapPoint *)hits->First())->GetY() - ((AliL3ConfMapPoint *)hits->Last())->GetY() ;
}
for(fTrack->StartLoop(); fTrack->LoopDone(); fTrack->GetNextHit())
{
// AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)hits->At(hit_counter);
- AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->currentHit;
- // if ( currentHit != firstHit )
- if(cHit != fTrack->firstHit)// hits->First())
+ AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->GetCurrentHit();
+ // if ( GetCurrentHit() != GetFirstHit() )
+ if(cHit != fTrack->GetFirstHit())// hits->First())
{
dx = cHit->GetX() - previousHit->GetX() ;
dy = cHit->GetY() - previousHit->GetY() ;
for(fTrack->StartLoop(); fTrack->LoopDone(); fTrack->GetNextHit())
{
//AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)hits->At(hit_counter);
- AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->currentHit;
+ AliL3ConfMapPoint *cHit = (AliL3ConfMapPoint*)fTrack->GetCurrentHit();
r1 = cHit->GetZ() - tanl * cHit->GetS() - z0 ;
chi2 += (Double_t) ( (Double_t)cHit->GetZWeight() * (r1 * r1) );
}
ClassImp(AliL3ConfMapPoint)
-Bool_t AliL3ConfMapPoint::fDontMap=kFALSE;
+Bool_t AliL3ConfMapPoint::fgDontMap=kFALSE;
AliL3ConfMapPoint::AliL3ConfMapPoint()
{
AliL3ConfMapPoint::~AliL3ConfMapPoint()
{
// Destructor.
- // Does nothing except destruct.
+ ;
}
-Bool_t AliL3ConfMapPoint::ReadHits(AliL3SpacePointData* hits ){
-
+Bool_t AliL3ConfMapPoint::ReadHits(AliL3SpacePointData* hits )
+{
+ //read the hits
SetHitNumber(hits->fID);
SetPadRow(hits->fPadRow);
Int_t slice = (hits->fID>>25) & 0x7f;
void AliL3ConfMapPoint::Setup(AliL3Vertex *vertex)
{
- //Setup. Sets the vertex, conformal coordinates, and phi and eta of each hit.
+ //Setup. Sets the vertex, conformal coordinates,
+ //and phi and eta of each hit.
SetIntPoint(vertex->GetX(), vertex->GetY(), vertex->GetZ(),
vertex->GetXErr(), vertex->GetYErr(), vertex->GetZErr());
SetShiftedCoord();
SetConfCoord();
- // The angles are set properly if they are set after the interaction point and the shifted coordinates
+ // The angles are set properly if they are set after
+ // the interaction point and the shifted coordinates
SetAngles();
//SetDist(0., 0.);
-
return;
}
// assumed to be at (0, 0, 0). Otherwise the function will use the
// interaction point specified by fXt and fYt.
- if(fDontMap){
- fXprime = x;
- fYprime = y;
+ if(fgDontMap){
+ fXprime = fx;
+ fYprime = fy;
fWxy = 0;
- s = 0; //track trajectory
+ fs = 0; //track trajectory
fWz = 0;
return;
}
fYprime = -fYv / r2;
//set weights:
- fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((xerr*xerr)+(yerr*yerr)));
- s = 0; //track trajectory
- fWz = (Double_t)(1./(szErrorScale*zerr*zerr));
+ fWxy = r2*r2 / ((xyErrorScale*xyErrorScale)*((fxerr*fxerr)+(fyerr*fyerr)));
+ fs = 0; //track trajectory
+ fWz = (Double_t)(1./(szErrorScale*fzerr*fzerr));
} else {
fXprime = 0.;
fYprime = 0.;
fYprimeerr = 0.;
fWxy = 0;
fWz = 0;
- s = 0;
+ fs = 0;
}
return;
}
*/
//fPhi = TMath::ATan2(y,x);
- fPhi = atan2(y,x);
+ fPhi = atan2(fy,fx);
//if(fPhi<0) fPhi = fPhi + 2*TMath::Pi();
//fEta = 0.5 * TMath::Log((r3dim + fZv)/(r3dim - fZv));
fEta = 0.5 * log((r3dim + fZv)/(r3dim - fZv));
return;
}
+
/*
AliL3ConfMapTrack *AliL3ConfMapPoint::GetTrack(TClonesArray *tracks) const
{
private:
- Int_t fHitNumber;
- Int_t fTrackNumber;
- Int_t fNextHitNumber;
- Bool_t fUsed;
- Int_t fPadrow;
- Int_t fSector;
+ Int_t fHitNumber; //hit number
+ Int_t fTrackNumber; //track number
+ Int_t fNextHitNumber; //next hit number
+ Bool_t fUsed; //flag is used
+ Int_t fPadrow; //padrow
+ Int_t fSector; //sector
//global coordinates and their errors
- Double_t x;
- Double_t y;
- Double_t z;
- Double_t xerr;
- Double_t yerr;
- Double_t zerr;
+ Double_t fx; //glob x
+ Double_t fy; //glob y
+ Double_t fz; //glob z
+ Double_t fxerr; //glob xerr
+ Double_t fyerr; //glob yerr
+ Double_t fzerr; //glob zerr
Double_t fWxy; // x-y weight on x-y
Double_t fWz; // z weight on z
- Float_t s; //track trajectory
+ Float_t fs; //track trajectory
// Interaction point
Double_t fXt; // x-value of the interaction point
Double_t fPhi; // angle phi
Double_t fEta; // pseudorapidity
- static Bool_t fDontMap; //flag to switch off mapping
+ static Bool_t fgDontMap; //flag to switch off mapping
public:
AliL3ConfMapPoint *nextRowHit; //!
AliL3ConfMapPoint *nextTrackHit; //! Linked chain of points in a track
- Short_t phiIndex;
- Short_t etaIndex;
+ Short_t phiIndex; //phi index
+ Short_t etaIndex; //eta index
- Double_t xyChi2;
- Double_t szChi2;
+ Double_t xyChi2; //xy chi
+ Double_t szChi2; //z chi
Int_t fMCTrackID[3]; //MClabel of tracks, may overlap
// getter
- Double_t GetX() const {return x;}
- Double_t GetY() const {return y;}
- Double_t GetZ() const {return z;}
- Double_t GetXerr() const {return xerr;}
- Double_t GetYerr() const {return yerr;}
- Double_t GetZerr() const {return zerr;}
+ Double_t GetX() const {return fx;}
+ Double_t GetY() const {return fy;}
+ Double_t GetZ() const {return fz;}
+ Double_t GetXerr() const {return fxerr;}
+ Double_t GetYerr() const {return fyerr;}
+ Double_t GetZerr() const {return fzerr;}
Int_t GetPadRow() const {return fPadrow;}
Int_t GetSector() const {return fSector;}
Double_t GetXYWeight() const {return fWxy;}
Double_t GetZWeight() const {return fWz;}
- Float_t GetS() const {return s;}
+ Float_t GetS() const {return fs;}
//AliL3ConfMapTrack *GetTrack(TClonesArray *tracks) const;
Int_t GetHitNumber() const {return fHitNumber;}
Int_t GetNextHitNumber() const {return fNextHitNumber;}
Int_t GetTrackNumber() const {return fTrackNumber;}
- // Int_t const *GetMCTrackID() const {return fMCTrackID;}
+ //Int_t const *GetMCTrackID() const {return fMCTrackID;}
// setter
- static void SetDontMap(Bool_t b){fDontMap=b;}
-
- void SetX(Double_t f) {x=f;}
- void SetY(Double_t f) {y=f;}
- void SetZ(Double_t f) {z=f;}
- void SetXerr(Double_t f) {xerr=f;}
- void SetYerr(Double_t f) {yerr=f;}
- void SetZerr(Double_t f) {zerr=f;}
+ static void SetDontMap(Bool_t b){fgDontMap=b;}
+
+ void SetX(Double_t f) {fx=f;}
+ void SetY(Double_t f) {fy=f;}
+ void SetZ(Double_t f) {fz=f;}
+ void SetXerr(Double_t f) {fxerr=f;}
+ void SetYerr(Double_t f) {fyerr=f;}
+ void SetZerr(Double_t f) {fzerr=f;}
void SetPadRow(Int_t f) {fPadrow=f;}
void SetSector(Int_t f) {fSector=f;}
void SetMCTrackID(Int_t f,Int_t g,Int_t h) {fMCTrackID[0] = f; fMCTrackID[1]=g; fMCTrackID[2]=h;}
void SetXYWeight(Float_t f) {fWxy = f;}
void SetZWeight(Float_t f) {fWz = f;}
- void SetS(Float_t f) {s = f;}
+ void SetS(Float_t f) {fs = f;}
void SetUsage(Bool_t f) {fUsed=f;}
AliL3ConfMapTrack::AliL3ConfMapTrack()
{
//Constructor
-
fChiSq[0] = 0.;
fChiSq[1] = 0.;
}
AliL3ConfMapTrack::~AliL3ConfMapTrack()
{
-
+ //deconstructor
}
void AliL3ConfMapTrack::DeleteCandidate()
//Deletes this track by resetting all its parameters. Does not delete
//the object itself.
- AliL3ConfMapPoint *curHit = (AliL3ConfMapPoint*)firstHit;
+ AliL3ConfMapPoint *curHit = (AliL3ConfMapPoint*)fFirstHit;
AliL3ConfMapPoint *nextHit;
while(curHit != 0)
void AliL3ConfMapTrack::SetProperties(Bool_t usage)
{
//Set the hits to this track to 'usage'
-
for(StartLoop(); LoopDone(); GetNextHit())
{
- AliL3ConfMapPoint *p = (AliL3ConfMapPoint*)currentHit;
+ AliL3ConfMapPoint *p = (AliL3ConfMapPoint*)fCurrentHit;
p->SetUsage(usage);
}
return;
//Resets the fit parameters of this track.
//xy-plane
- s11Xy = 0;
- s12Xy = 0;
- s22Xy = 0;
- g1Xy = 0;
- g2Xy = 0;
+ fs11Xy = 0;
+ fs12Xy = 0;
+ fs22Xy = 0;
+ fg1Xy = 0;
+ fg2Xy = 0;
fChiSq[0] = 0.;
//sz-plane
- s11Sz = 0;
- s12Sz = 0;
- s22Sz = 0;
- g1Sz = 0;
- g2Sz = 0;
+ fs11Sz = 0;
+ fs12Sz = 0;
+ fs22Sz = 0;
+ fg1Sz = 0;
+ fg2Sz = 0;
fChiSq[1] = 0;
SetLength(0);
SetNHits(0);
//Set the hit pointers:
//if(fNHits == 1)
if(GetNHits()==1)
- firstHit = thisHit;
+ fFirstHit = thisHit;
else
- ((AliL3ConfMapPoint*)lastHit)->nextTrackHit = thisHit;
- lastHit = thisHit;
+ ((AliL3ConfMapPoint*)fLastHit)->nextTrackHit = thisHit;
+ fLastHit = thisHit;
- s11Xy = s11Xy + thisHit->GetXYWeight() ;
- s12Xy = s12Xy + thisHit->GetXYWeight() * thisHit->GetXprime() ;
- s22Xy = s22Xy + thisHit->GetXYWeight() * pow((thisHit->GetXprime()),2) ;
- g1Xy = g1Xy + thisHit->GetXYWeight() * thisHit->GetYprime() ;
- g2Xy = g2Xy + thisHit->GetXYWeight() * thisHit->GetXprime() * thisHit->GetYprime() ;
+ fs11Xy = fs11Xy + thisHit->GetXYWeight() ;
+ fs12Xy = fs12Xy + thisHit->GetXYWeight() * thisHit->GetXprime() ;
+ fs22Xy = fs22Xy + thisHit->GetXYWeight() * pow((thisHit->GetXprime()),2) ;
+ fg1Xy = fg1Xy + thisHit->GetXYWeight() * thisHit->GetYprime() ;
+ fg2Xy = fg2Xy + thisHit->GetXYWeight() * thisHit->GetXprime() * thisHit->GetYprime() ;
- ddXy = s11Xy * s22Xy - pow((s12Xy),2) ;
- if ( ddXy != 0 )
+ fddXy = fs11Xy * fs22Xy - pow((fs12Xy),2) ;
+ if ( fddXy != 0 )
{
- a1Xy = ( g1Xy * s22Xy - g2Xy * s12Xy ) / ddXy ;
- a2Xy = ( g2Xy * s11Xy - g1Xy * s12Xy ) / ddXy ;
+ fa1Xy = ( fg1Xy * fs22Xy - fg2Xy * fs12Xy ) / fddXy ;
+ fa2Xy = ( fg2Xy * fs11Xy - fg1Xy * fs12Xy ) / fddXy ;
}
// Now in the sz plane
- s11Sz = s11Sz + thisHit->GetZWeight() ;
- s12Sz = s12Sz + thisHit->GetZWeight() * thisHit->GetS() ;
- s22Sz = s22Sz + thisHit->GetZWeight() * thisHit->GetS() * thisHit->GetS() ;
- g1Sz = g1Sz + thisHit->GetZWeight() * thisHit->GetZ() ;
- g2Sz = g2Sz + thisHit->GetZWeight() * thisHit->GetS() * thisHit->GetZ() ;
+ fs11Sz = fs11Sz + thisHit->GetZWeight() ;
+ fs12Sz = fs12Sz + thisHit->GetZWeight() * thisHit->GetS() ;
+ fs22Sz = fs22Sz + thisHit->GetZWeight() * thisHit->GetS() * thisHit->GetS() ;
+ fg1Sz = fg1Sz + thisHit->GetZWeight() * thisHit->GetZ() ;
+ fg2Sz = fg2Sz + thisHit->GetZWeight() * thisHit->GetS() * thisHit->GetZ() ;
- ddSz = s11Sz * s22Sz - s12Sz * s12Sz ;
- if ( ddSz != 0 ) {
- a1Sz = ( g1Sz * s22Sz - g2Sz * s12Sz ) / ddSz ;
- a2Sz = ( g2Sz * s11Sz - g1Sz * s12Sz ) / ddSz ;
+ fddSz = fs11Sz * fs22Sz - fs12Sz * fs12Sz ;
+ if ( fddSz != 0 ) {
+ fa1Sz = ( fg1Sz * fs22Sz - fg2Sz * fs12Sz ) / fddSz ;
+ fa2Sz = ( fg2Sz * fs11Sz - fg1Sz * fs12Sz ) / fddSz ;
}
}
{
//Fill track variables with or without fit.
- //fRadius = sqrt(a2Xy*a2Xy+1)/(2*fabs(a1Xy));
- Double_t radius = sqrt(a2Xy*a2Xy+1)/(2*fabs(a1Xy));
+ //fRadius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
+ Double_t radius = sqrt(fa2Xy*fa2Xy+1)/(2*fabs(fa1Xy));
SetRadius(radius);
//fPt = (Double_t)(AliL3Transform::GetBFieldValue() * fRadius);
ComesFromMainVertex(AliLevel3::DoVertexFit());
fit->FitHelix();
- //AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)lastHit;
- AliL3ConfMapPoint *fHit = (AliL3ConfMapPoint*)firstHit;
+ //AliL3ConfMapPoint *lHit = (AliL3ConfMapPoint*)fLastHit;
+ AliL3ConfMapPoint *fHit = (AliL3ConfMapPoint*)fFirstHit;
SetLastPoint(fHit->GetX(),fHit->GetY(),fHit->GetZ());
UpdateToFirstPoint();
class AliL3Vertex;
class AliL3ConfMapTrack :public AliL3Track {
-
- private:
-
public:
AliL3ConfMapTrack();
virtual ~AliL3ConfMapTrack();
void Fill(AliL3Vertex *vertex,Double_t max_Dca);
- //void UpdateToFirstPoint();
void Reset();
void UpdateParam(AliL3ConfMapPoint *hit);
void DeleteCandidate();
- void StartLoop() {currentHit = firstHit;} //!
- void GetNextHit() {currentHit = ((AliL3ConfMapPoint*)currentHit)->nextTrackHit;} //!
- Int_t LoopDone() {return currentHit != 0;} //!
- AliL3ConfMapPoint *currentHit; //!
- AliL3ConfMapPoint *lastHit; //!
- AliL3ConfMapPoint *firstHit; //!
+ void StartLoop() {fCurrentHit = fFirstHit;}
+ void GetNextHit() {fCurrentHit = ((AliL3ConfMapPoint*)fCurrentHit)->nextTrackHit;}
+ Int_t LoopDone() const {return fCurrentHit != 0;}
+ // setter
+ void SetChiSq1(Double_t f) {fChiSq[0]=f;}
+ void SetChiSq2(Double_t f) {fChiSq[1]=f;}
+ void SetProperties(Bool_t fUsage);
// getter
Double_t const *GetChiSq() const { return fChiSq;}
+ Double_t GetChiSq1() const { return fChiSq[0]; }
+ Double_t GetChiSq2() const { return fChiSq[1]; }
+
+ /*
+ Double_t GetS11Xy() const {return fs11Xy;}
+ Double_t GetS12Xy() const {return fs12Xy;}
+ Double_t GetS22Xy() const {return fs22Xy;}
+ Double_t GetG1Xy() const {return fg1Xy;}
+ Double_t GetG2Xy() const {return fg2Xy;}
+ Double_t GetS11Sz() const {return fs11Sz;}
+ Double_t GetS12Sz() const {return fs12Sz;}
+ Double_t GetS22z() const {return fs22Sz;}
+ Double_t GetG1Sz() const {return fg1Sz;}
+ Double_t GetG2Sz() const { return fg2Sz;}
+ */
+
+ Double_t GetDDXy() const {return fddXy;}
+ Double_t GetA1Xy() const {return fa1Xy;}
+ Double_t GetA2Xy() const {return fa2Xy;}
+ Double_t GetDDSz() const {return fddSz;}
+ Double_t GetA1Sz() const {return fa1Sz;}
+ Double_t GetA2Sz() const {return fa2Sz;}
+
+ AliL3ConfMapPoint* GetFirstHit() const {return fFirstHit;}
+ AliL3ConfMapPoint* GetLastHit() const {return fLastHit;}
+ AliL3ConfMapPoint* GetCurrentHit() const {return fCurrentHit;}
Int_t GetMCLabel();
- // setter
- void SetChiSq1(Double_t f) {fChiSq[0]=f;}
- void SetChiSq2(Double_t f) {fChiSq[1]=f;}
- void SetProperties(Bool_t fUsage);
+ protected:
+
+ AliL3ConfMapPoint *fCurrentHit; //!
+ AliL3ConfMapPoint *fLastHit; //!
+ AliL3ConfMapPoint *fFirstHit; //!
+
- Double_t fChiSq[2];
+ Double_t fChiSq[2]; //chi squared
//fit parameters. Bad naming convention, i know...
- Double_t s11Xy ;
- Double_t s12Xy ;
- Double_t s22Xy ;
- Double_t g1Xy ;
- Double_t g2Xy ;
- Double_t s11Sz ;
- Double_t s12Sz ;
- Double_t s22Sz ;
- Double_t g1Sz ;
- Double_t g2Sz ;
+ Double_t fs11Xy; //helper
+ Double_t fs12Xy; //helper
+ Double_t fs22Xy; //helper
+ Double_t fg1Xy; //helper
+ Double_t fg2Xy; //helper
+ Double_t fs11Sz; //helper
+ Double_t fs12Sz; //helper
+ Double_t fs22Sz; //helper
+ Double_t fg1Sz; //helper
+ Double_t fg2Sz; //helper
- Double_t ddXy, a1Xy, a2Xy ; /*fit par in xy */
- Double_t ddSz, a1Sz, a2Sz ; /*fit par in sz */
+ Double_t fddXy, fa1Xy, fa2Xy ; /*fit par in xy */
+ Double_t fddSz, fa1Sz, fa2Sz ; /*fit par in sz */
ClassDef(AliL3ConfMapTrack,1) //Conformal mapping track class
};
AliL3ConfMapper::~AliL3ConfMapper()
{
// Destructor.
-
if(fVolume) {
delete [] fVolume;
}
Bool_t AliL3ConfMapper::ReadHits(UInt_t count, AliL3SpacePointData* hits )
{
+ //read hits
Int_t nhit=(Int_t)count;
for (Int_t i=0;i<nhit;i++)
{
void AliL3ConfMapper::NonVertexSettings(Int_t trackletlength, Int_t tracklength,
Int_t rowscopetracklet, Int_t rowscopetrack)
{
+ //set parameters for non-vertex tracking
SetTrackletLength(trackletlength,(Bool_t)false);
SetRowScopeTracklet(rowscopetracklet, (Bool_t)false);
SetRowScopeTrack(rowscopetrack, (Bool_t)false);
tracks++;
//define variables to keep the total chi:
- Double_t xyChi2 = track->fChiSq[0];
- Double_t szChi2 = track->fChiSq[1];
+ Double_t xyChi2 = track->GetChiSq1();
+ Double_t szChi2 = track->GetChiSq2();
for(point = fTrackletLength[fVertexConstraint]; point <= fNumRowSegment; point++)
{
- track->fChiSq[0] = fHitChi2Cut[fVertexConstraint];
- closest_hit = GetNextNeighbor((AliL3ConfMapPoint*)track->lastHit,track);
+ track->SetChiSq1(fHitChi2Cut[fVertexConstraint]);
+ closest_hit = GetNextNeighbor((AliL3ConfMapPoint*)track->GetLastHit(),track);
if(closest_hit)
{
-
//keep total chi:
- Double_t lxyChi2 = track->fChiSq[0]-track->fChiSq[1];
+ Double_t lxyChi2 = track->GetChiSq1()-track->GetChiSq2();
xyChi2 += lxyChi2;
closest_hit->xyChi2 = lxyChi2;
//update track length:
//track->fLength = closest_hit->GetS();
track->SetLength(closest_hit->GetS());
- szChi2 += track->fChiSq[1];
- closest_hit->szChi2 = track->fChiSq[1];
+ szChi2 += track->GetChiSq2();
+ closest_hit->szChi2 = track->GetChiSq2();
track->UpdateParam(closest_hit);
trackhitnumber[track->GetNumberOfPoints()-1] = closest_hit->GetHitNumber();
}//create tracks
//store track chi2:
- track->fChiSq[0] = xyChi2;
- track->fChiSq[1] = szChi2;
- Double_t normalized_chi2 = (track->fChiSq[0]+track->fChiSq[1])/track->GetNumberOfPoints();
+ track->SetChiSq1(xyChi2);
+ track->SetChiSq2(szChi2);
+ Double_t normalized_chi2 = (track->GetChiSq1()+track->GetChiSq2())/track->GetNumberOfPoints();
//remove tracks with not enough points already now
if(track->GetNumberOfPoints() < fMinPoints[fVertexConstraint] || normalized_chi2 > fTrackChi2Cut[fVertexConstraint])
//Check if space point gives a fit with acceptable chi2.
Double_t temp,dxy,lchi2,dx,dy,slocal,dsz,lszChi2;
- temp = (track->a2Xy*hit->GetXprime()-hit->GetYprime()+track->a1Xy);
- dxy = temp*temp/(track->a2Xy*track->a2Xy + 1.);
+ temp = (track->GetA2Xy()*hit->GetXprime()-hit->GetYprime()+track->GetA1Xy());
+ dxy = temp*temp/(track->GetA2Xy()*track->GetA2Xy() + 1.);
//Calculate chi2
lchi2 = (dxy*hit->GetXYWeight());
- if(lchi2 > track->fChiSq[0])//chi2 was worse than before.
+ if(lchi2 > track->GetChiSq1())//chi2 was worse than before.
return 0;
//calculate s and the distance hit-line
//slocal = track->fLength+sqrt(dx*dx+dy*dy);
slocal = track->GetLength()+sqrt(dx*dx+dy*dy);
- temp = (track->a2Sz*slocal-hit->GetZ()+track->a1Sz);
- dsz = temp*temp/(track->a2Sz*track->a2Sz+1);
+ temp = (track->GetA2Sz()*slocal-hit->GetZ()+track->GetA1Sz());
+ dsz = temp*temp/(track->GetA2Sz()*track->GetA2Sz()+1);
//calculate chi2
lszChi2 = dsz*hit->GetZWeight();
//check whether chi2 is better than previous one:
- if(lchi2 < track->fChiSq[0])
+ if(lchi2 < track->GetChiSq1())
{
- track->fChiSq[0] = lchi2;
- track->fChiSq[1] = lszChi2;
+ track->SetChiSq1(lchi2);
+ track->SetChiSq2(lszChi2);
hit->SetS(slocal);
Int_t counter=0;
for(track->StartLoop(); track->LoopDone(); track->GetNextHit())
{
- AliL3ConfMapPoint *p = (AliL3ConfMapPoint*)track->currentHit;
+ AliL3ConfMapPoint *p = (AliL3ConfMapPoint*)track->GetCurrentHit();
if( (n-1) == counter)
{
x1[0] = p->GetX();
//which should be done in order to get nice tracks.
Int_t num_of_tracks = nTracks;
- LOG(AliL3Log::kInformational,"AliL3ConfMapper::FillTracks","nTracks")<<AliL3Log::kDec<<
- "Number of found tracks: "<<nTracks<<ENDLOG;
-
if(nTracks == 0)
{
LOG(AliL3Log::kError,"AliL3ConfMapper::FillTracks","nTracks")<<AliL3Log::kDec<<
"No tracks found!!"<<ENDLOG;
return 0;
}
+
+ LOG(AliL3Log::kInformational,"AliL3ConfMapper::FillTracks","nTracks")<<AliL3Log::kDec<<
+ "Number of found tracks: "<<nTracks<<ENDLOG;
// fTrack->Sort();
- for(int i=0; i<num_of_tracks; i++)
+ for(Int_t i=0; i<num_of_tracks; i++)
{
AliL3ConfMapTrack *track = (AliL3ConfMapTrack*)fTrack->GetTrack(i);
track->Fill(fVertex,fMaxDca);
-
}
return 1;
-
}
Double_t AliL3ConfMapper::CpuTime()
struct timeval tv;
gettimeofday( &tv, NULL );
return tv.tv_sec+(((Double_t)tv.tv_usec)/1000000.);
- //return (Double_t)(clock()) / CLOCKS_PER_SEC;
}
AliL3Display::AliL3Display()
{
+ //constructor
fGeom = NULL;
fTracks = NULL;
}
AliL3Display::~AliL3Display()
{
-
+ //destructor
if(fTracks)
delete fTracks;
}
class AliL3Display : public TObject {
private:
- TGeometry *fGeom;
+ TGeometry *fGeom; //!
AliL3SpacePointData *fClusters[36][6]; //!
AliL3TrackArray *fTracks; //!
- UInt_t fNcl[36][6];
-
- Int_t fMinSlice;
- Int_t fMaxSlice;
+ UInt_t fNcl[36][6]; //number of cluster
+ Int_t fMinSlice; //min slice
+ Int_t fMaxSlice; //max slice
public:
AliL3Display();
//*-- Copyright © ALICE HLT Group
#include "AliL3StandardIncludes.h"
+#include <TObject.h>
#include <TFile.h>
#include <TH1.h>
#include <TParticle.h>
#include <TTree.h>
#include <TClonesArray.h>
+#include <TTree.h>
+#include <TNtuple.h>
#include <AliRun.h>
#include <AliSimDigits.h>
ClassImp(AliL3Evaluate)
AliL3Evaluate::AliL3Evaluate()
-{
+{
+ //constructor
Clear();
}
AliL3Evaluate::AliL3Evaluate(Char_t *datapath,Int_t min_clusters,Int_t minhits,Double_t minpt,Double_t maxpt,Int_t *slice)
-{
+{
+ //constructor
Clear();
if(slice)
}
AliL3Evaluate::~AliL3Evaluate()
-{
+{
+ //destructor
if(fGoodTracks) delete[] fGoodTracks;
if(fTracks) delete fTracks;
if(fPtRes) delete fPtRes;
}
void AliL3Evaluate::Clear()
-{
+{
+ //clear
fTracks = 0;
fMinSlice=0;
fMaxSlice=0;
}
void AliL3Evaluate::LoadData(Int_t event,Bool_t sp)
-{
+{
+ //load cluster points
Char_t fname[1024];
for(Int_t s=fMinSlice; s<=fMaxSlice; s++)
}
void AliL3Evaluate::AssignPIDs()
-{
+{
+ //assign pid
if(!fTracks) return;
fTracks->QSort();
LOG(AliL3Log::kDebug,"AliL3Evaluate::AssignPIDs","Track Loop")
}
void AliL3Evaluate::AssignIDs()
-{
+{
//Assign MC id to the tracks.
#ifndef do_mc
cerr<<"AliL3Evaluate::AssignIDs() : You need to compile with the do_mc flag!"<<endl;
}
Float_t AliL3Evaluate::GetTrackPID(AliL3Track *track)
-{
+{
+ //get track pid
track->CalculateHelix();
// Track dEdx
Int_t nc=track->GetNHits();
}
struct S {Int_t lab; Int_t max;};
-Int_t AliL3Evaluate::GetMCTrackLabel(AliL3Track *track){
+Int_t AliL3Evaluate::GetMCTrackLabel(AliL3Track *track)
+{
//Returns the MCtrackID of the belonging clusters.
//If MCLabel < 0, means that track is fake.
//Definitions are identical to offline.
if(fGoodTracks)
delete [] fGoodTracks;
fGoodGen=0;
- fGoodTracks = new GoodTrack[MaxTracks];
+ fGoodTracks = new AliGoodTrack[MaxTracks];
if(fStandardComparison){
- while (in>>fGoodTracks[fGoodGen].label>>fGoodTracks[fGoodGen].code>>
- fGoodTracks[fGoodGen].px>>fGoodTracks[fGoodGen].py>>fGoodTracks[fGoodGen].pz>>
- fGoodTracks[fGoodGen].x>>fGoodTracks[fGoodGen].y>>fGoodTracks[fGoodGen].z)
+ while (in>>fGoodTracks[fGoodGen].flabel>>fGoodTracks[fGoodGen].fcode>>
+ fGoodTracks[fGoodGen].fpx>>fGoodTracks[fGoodGen].fpy>>fGoodTracks[fGoodGen].fpz>>
+ fGoodTracks[fGoodGen].fx>>fGoodTracks[fGoodGen].fy>>fGoodTracks[fGoodGen].fz)
{
- fGoodTracks[fGoodGen].nhits=-1;
- fGoodTracks[fGoodGen].sector=-1;
+ fGoodTracks[fGoodGen].fnhits=-1;
+ fGoodTracks[fGoodGen].fsector=-1;
fGoodGen++;
if (fGoodGen==MaxTracks)
{
}
}
} else {
- while (in>>fGoodTracks[fGoodGen].label>>fGoodTracks[fGoodGen].code>>
- fGoodTracks[fGoodGen].px>>fGoodTracks[fGoodGen].py>>fGoodTracks[fGoodGen].pz>>
- fGoodTracks[fGoodGen].x>>fGoodTracks[fGoodGen].y >>fGoodTracks[fGoodGen].z>>fGoodTracks[fGoodGen].nhits>>fGoodTracks[fGoodGen].sector)
+ while (in>>fGoodTracks[fGoodGen].flabel>>fGoodTracks[fGoodGen].fcode>>
+ fGoodTracks[fGoodGen].fpx>>fGoodTracks[fGoodGen].fpy>>fGoodTracks[fGoodGen].fpz>>
+ fGoodTracks[fGoodGen].fx>>fGoodTracks[fGoodGen].fy >>fGoodTracks[fGoodGen].fz>>
+ fGoodTracks[fGoodGen].fnhits>>fGoodTracks[fGoodGen].fsector)
{
fGoodGen++;
if (fGoodGen==MaxTracks)
}
}
-//has to be modified for fakes.
-
void AliL3Evaluate::FillEffHistos()
-{
+{
+ //has to be modified for fakes.
+
if(!fGoodTracks)
{
cerr<<"AliL3Evaluate::FillEffHistos : No good tracks"<<endl;
{
//cout<<"Checking particle "<<i<<endl;
if(!fStandardComparison)
- if(fGoodTracks[i].nhits < fMinHitsFromParticle) continue;
- Float_t ptg = TMath::Sqrt(fGoodTracks[i].px*fGoodTracks[i].px + fGoodTracks[i].py*fGoodTracks[i].py);
+ if(fGoodTracks[i].fnhits < fMinHitsFromParticle) continue;
+ Float_t ptg = TMath::Sqrt(fGoodTracks[i].fpx*fGoodTracks[i].fpx + fGoodTracks[i].fpy*fGoodTracks[i].fpy);
if(ptg < fMinGoodPt || ptg > fMaxGoodPt) continue;
- Float_t pzg=fGoodTracks[i].pz;
+ Float_t pzg=fGoodTracks[i].fpz;
Float_t dipangle=TMath::ATan2(pzg,ptg)*180./TMath::Pi();
//If we are only considering tracks on one side of the TPC:
Int_t tracklabel;
tracklabel = track->GetMCid();
- if(TMath::Abs(tracklabel) != fGoodTracks[i].label) continue;
+ if(TMath::Abs(tracklabel) != fGoodTracks[i].flabel) continue;
found=1;
Float_t pt=track->GetPt();
- if(tracklabel == fGoodTracks[i].label)
+ if(tracklabel == fGoodTracks[i].flabel)
{
fNFoundTracksPt->Fill(ptg);
fNFoundTracksEta->Fill(dipangle);
for(Int_t i=0; i<fGoodGen; i++)
{
if(!fStandardComparison)
- if(fGoodTracks[i].nhits < fMinHitsFromParticle) continue;
- Double_t ptg=TMath::Sqrt(fGoodTracks[i].px*fGoodTracks[i].px + fGoodTracks[i].py*fGoodTracks[i].py);
+ if(fGoodTracks[i].fnhits < fMinHitsFromParticle) continue;
+ Double_t ptg=TMath::Sqrt(fGoodTracks[i].fpx*fGoodTracks[i].fpx + fGoodTracks[i].fpy*fGoodTracks[i].fpy);
if(ptg < fMinGoodPt || ptg > fMaxGoodPt) continue;
- Double_t pzg=fGoodTracks[i].pz;
+ Double_t pzg=fGoodTracks[i].fpz;
Float_t dipangle=TMath::ATan2(pzg,ptg)*180./TMath::Pi();
//printf("filling particle with pt %f and dipangle %f\n",ptg,dipangle);
fNGoodTracksPt->Fill(ptg);
//Float_t pt=track->GetPt();
//fPtRes->Fill((pt-ptg)/ptg*100.);
//fNtuppel->Fill(ptg,pt,nHits);
-
}
}
void AliL3Evaluate::CalcEffHistos()
-{
+{
+ //calc eff histos
Stat_t ngood=fNGoodTracksPt->GetEntries();
Stat_t nfound=fNFoundTracksPt->GetEntries();
}
TNtuple *AliL3Evaluate::GetNtuple()
-{
+{
+ //get ntuple
if(!fNtupleRes)
{
fNtupleRes = new TNtuple("ntuppel","Residuals","residual_trans:residual_long:zHit:pt:dipangle:beta:padrow:nHits");
}
void AliL3Evaluate::CalculateResiduals()
-{
-
+{
+ //calculate residuals
TNtuple *ntuppel = GetNtuple();
for(Int_t i=0; i<fTracks->GetNTracks(); i++)
ntuppel->Write();
ntuppel2->Write();
ofile->Close();
-
#endif
}
class TClonesArray;
-
-#include <TObject.h>
-#include <TH1.h>
-#include <TTree.h>
#include <TNtuple.h>
-#include "AliSimDigits.h"
-
+#include <TH1F.h>
-struct GoodTrack
+struct AliGoodTrack
{
- Int_t label;
- Double_t eta;
- Int_t code;
- Double_t px,py,pz;
- Double_t x,y,z;
- Int_t nhits;
- Int_t sector;
+ Int_t flabel; //label
+ Double_t feta; //eta
+ Int_t fcode; //pcode
+ Double_t fpx,fpy,fpz; //momentum
+ Double_t fx,fy,fz; //pos at entrance
+ Int_t fnhits; //nhits
+ Int_t fsector; //sector number
};
-typedef struct GoodTrack GoodTrack;
-
+typedef struct AliGoodTrack AliGoodTrack;
class AliL3Track;
class TClonesArray;
private:
AliL3TrackArray *fTracks; //!
- //AliTPCParam *fParam;
AliL3SpacePointData *fClusters[36][6]; //!
AliL3FileHandler *fClustersFile[36][6]; //!
- //TTree *fDigitsTree;
- //AliSimDigits *fDigits;
- Char_t fPath[1024];
- Int_t fMinSlice;
- Int_t fMaxSlice;
- UInt_t fNcl[36][6];
- Int_t fRowid[36][176];
- Int_t fMinPointsOnTrack; //Minimum points on track to be considered.
- Int_t fMinHitsFromParticle;
- GoodTrack *fGoodTracks; //!
- Float_t fMaxFalseClusters;
+ Char_t fPath[1024]; //path
+ Int_t fMinSlice; //min slice
+ Int_t fMaxSlice; //max slice
+ UInt_t fNcl[36][6]; //cluster numbers
+ Int_t fRowid[36][176]; //row ids
+ Int_t fMinPointsOnTrack; //minimum points on track to be considered.
+ Int_t fMinHitsFromParticle; //minimums hits a particle has to create
+ AliGoodTrack *fGoodTracks; //!
+ Float_t fMaxFalseClusters; //maximum number of false assigned clusters
- Int_t fNFastPoints;
+ Int_t fNFastPoints; //fast access to points
UInt_t *fMcIndex;//!
Int_t *fMcId;//!
- Int_t fGoodFound;
- Int_t fGoodGen;
- Double_t fMinGoodPt;
- Double_t fMaxGoodPt;
+ Int_t fGoodFound; //good found
+ Int_t fGoodGen; //good generated found
+ Double_t fMinGoodPt; //min pt
+ Double_t fMaxGoodPt; //max pt
//Histograms
- TNtuple *fNtuppel;
- TH1F *fPtRes;
- TH1F *fNGoodTracksPt;
- TH1F *fNFoundTracksPt;
- TH1F *fNFakeTracksPt;
- TH1F *fTrackEffPt;
- TH1F *fFakeTrackEffPt;
- TH1F *fNGoodTracksEta;
- TH1F *fNFoundTracksEta;
- TH1F *fNFakeTracksEta;
- TH1F *fTrackEffEta;
- TH1F *fFakeTrackEffEta;
- TNtuple *fNtupleRes;
- Bool_t fStandardComparison;
+ TNtuple *fNtuppel;//!
+ TH1F *fPtRes;//!
+ TH1F *fNGoodTracksPt;//!
+ TH1F *fNFoundTracksPt;//!
+ TH1F *fNFakeTracksPt;//!
+ TH1F *fTrackEffPt;//!
+ TH1F *fFakeTrackEffPt;//!
+ TH1F *fNGoodTracksEta;//!
+ TH1F *fNFoundTracksEta;//!
+ TH1F *fNFakeTracksEta;//!
+ TH1F *fTrackEffEta;//!
+ TH1F *fFakeTrackEffEta;//!
+ TNtuple *fNtupleRes;//!
+ Bool_t fStandardComparison; // take standard macro
void Clear();
public:
void SetMaxFalseClusters(Float_t f) {fMaxFalseClusters = f;}
void SetStandardComparison(Bool_t b) {fStandardComparison = b;}
TNtuple *GetNtuple();
- Int_t GetNGoodTracks() {return fGoodGen;}
- Int_t GetNFoundTracks() {return fGoodFound;}
+ Int_t GetNGoodTracks() const {return fGoodGen;}
+ Int_t GetNFoundTracks() const {return fGoodFound;}
TH1F *GetTrackEffPt() {return fTrackEffPt;}
TH1F *GetTrackEffEta() {return fTrackEffEta;}
TH1F *GetFakeEffEta() {return fFakeTrackEffEta;}
ClassImp(AliL3FileHandler)
// of course on start up the index is not created
-Bool_t AliL3FileHandler::fStaticIndexCreated=kFALSE;
-Int_t AliL3FileHandler::fStaticIndex[36][159];
+Bool_t AliL3FileHandler::fgStaticIndexCreated=kFALSE;
+Int_t AliL3FileHandler::fgStaticIndex[36][159];
void AliL3FileHandler::CleanStaticIndex()
-{ // use this static call to clean static index after
+{
+ // use this static call to clean static index after
// running over one event
-
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fStaticIndex[i][j]=-1;
+ fgStaticIndex[i][j]=-1;
}
- fStaticIndexCreated=kFALSE;
+ fgStaticIndexCreated=kFALSE;
}
Int_t AliL3FileHandler::SaveStaticIndex(Char_t *prefix,Int_t event)
-{ // use this static call to store static index after
- if(!fStaticIndexCreated) return -1;
+{
+ // use this static call to store static index after
+ if(!fgStaticIndexCreated) return -1;
Char_t fname[1024];
if(prefix)
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- file << fStaticIndex[i][j] << " ";
+ file << fgStaticIndex[i][j] << " ";
file << endl;
}
file.close();
}
Int_t AliL3FileHandler::LoadStaticIndex(Char_t *prefix,Int_t event)
-{ // use this static call to store static index after
- if(fStaticIndexCreated){
+{
+ // use this static call to store static index after
+ if(fgStaticIndexCreated){
LOG(AliL3Log::kWarning,"AliL3FileHandler::LoadStaticIndex","Inxed")
<<"Static index already created, will overwrite"<<ENDLOG;
CleanStaticIndex();
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- file >> fStaticIndex[i][j];
+ file >> fgStaticIndex[i][j];
}
file.close();
- fStaticIndexCreated=kTRUE;
+ fgStaticIndexCreated=kTRUE;
return 0;
}
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
fIndex[i][j]=-1;
- if(fUseStaticIndex&&!fStaticIndexCreated) CleanStaticIndex();
+ if(fUseStaticIndex&&!fgStaticIndexCreated) CleanStaticIndex();
}
AliL3FileHandler::~AliL3FileHandler()
}
void AliL3FileHandler::FreeDigitsTree()
-{
+{
+ //free digits tree
if(!fDigitsTree)
{
LOG(AliL3Log::kInformational,"AliL3FileHandler::FreeDigitsTree()","Pointer")
}
Bool_t AliL3FileHandler::SetMCOutput(Char_t *name)
-{
+{
+ //set mc input
fMC = fopen(name,"w");
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
}
Bool_t AliL3FileHandler::SetMCOutput(FILE *file)
-{
+{
+ //set mc output
fMC = file;
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
}
void AliL3FileHandler::CloseMCOutput()
-{
+{
+ //close mc output
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::CloseMCOutPut","File Close")
<<"Nothing to Close"<<ENDLOG;
}
Bool_t AliL3FileHandler::SetAliInput()
-{
+{
+ //set ali input
#ifdef use_newio
fInAli->CdGAFile();
fParam = AliTPC::LoadTPCParam(gFile);
}
Bool_t AliL3FileHandler::SetAliInput(Char_t *name)
-{
+{
//Open the AliROOT file with name.
#ifdef use_newio
fInAli= AliRunLoader::Open(name);
#ifdef use_newio
Bool_t AliL3FileHandler::SetAliInput(AliRunLoader *runLoader)
-{
+{
+ //set ali input as runloader
fInAli=runLoader;
fUseRunLoader = kTRUE;
if(!fInAli){
#ifdef use_newio
Bool_t AliL3FileHandler::SetAliInput(TFile */*file*/)
{
+ //Specify already opened AliROOT file to use as an input.
LOG(AliL3Log::kFatal,"AliL3FileHandler::SetAliInput","File Open")
<<"This function is not supported for NEWIO, check ALIHLT_USENEWIO settings in Makefile.conf"<<ENDLOG;
return kFALSE;
}
#else
Bool_t AliL3FileHandler::SetAliInput(TFile *file)
-{
+{
//Specify already opened AliROOT file to use as an input.
fInAli=file;
if(!fInAli){
#endif
void AliL3FileHandler::CloseAliInput()
-{
+{
+ //close ali input
#ifdef use_newio
if(fUseRunLoader) return;
#endif
///////////////////////////////////////// Digit IO
Bool_t AliL3FileHandler::AliDigits2Binary(Int_t event,Bool_t altro)
{
+ //save alidigits as binary
Bool_t out = kTRUE;
UInt_t nrow;
AliL3DigitRowData* data = 0;
//create the access index or copy from static index
fIndexCreated=kFALSE;
- if(!fStaticIndexCreated || !fUseStaticIndex) { //we have to create index
+ if(!fgStaticIndexCreated || !fUseStaticIndex) { //we have to create index
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
<<"Starting to create index, this can take a while."<<ENDLOG;
if(fUseStaticIndex) { // create static index
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fStaticIndex[i][j]=fIndex[i][j];
+ fgStaticIndex[i][j]=fIndex[i][j];
}
- fStaticIndexCreated=kTRUE; //remember that index has been created
+ fgStaticIndexCreated=kTRUE; //remember that index has been created
}
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
} else if(fUseStaticIndex) { //simply copy static index
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fIndex[i][j]=fStaticIndex[i][j];
+ fIndex[i][j]=fgStaticIndex[i][j];
}
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
<<"Index successfully taken from static copy."<<ENDLOG;
-
}
-
fIndexCreated=kTRUE;
return kTRUE;
}
}
///////////////////////////////////////// Point IO
-Bool_t AliL3FileHandler::AliPoints2Binary(Int_t eventn){
+Bool_t AliL3FileHandler::AliPoints2Binary(Int_t eventn)
+{
+ //points to binary
Bool_t out = kTRUE;
UInt_t npoint;
AliL3SpacePointData *data = AliPoints2Memory(npoint,eventn);
return out;
}
-AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint,Int_t eventn){
+AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint,Int_t eventn)
+{
+ //points to memory
AliL3SpacePointData *data = 0;
npoint=0;
if(!fInAli){
protected:
#ifdef use_newio
- AliRunLoader *fInAli;
- Bool_t fUseRunLoader;
+ AliRunLoader *fInAli;//!
+ Bool_t fUseRunLoader; //use runloader
#else
- TFile *fInAli;
+ TFile *fInAli;//!
#endif
- AliTPCParam *fParam;
- virtual Bool_t SetAliInput();
- AliSimDigits *fDigits;
+ AliTPCParam *fParam;//!
+ AliSimDigits *fDigits;//!
- TTree *fDigitsTree;
+ TTree *fDigitsTree;//!
FILE *fMC;//!
Bool_t fIndexCreated; //is index created
Int_t fIndex[36][159]; //stores index over digitstree
//for faster access w/o ASVVERSION
Bool_t fUseStaticIndex; //take static index
- static Bool_t fStaticIndexCreated; //global index created
- static Int_t fStaticIndex[36][159]; //global index
+ static Bool_t fgStaticIndexCreated; //global index created
+ static Int_t fgStaticIndex[36][159]; //global index
+ virtual Bool_t SetAliInput();
Bool_t GetDigitsTree(Int_t event);
Bool_t CreateIndex(); //create the index
#ifndef ALIL3LOG_H
#define ALIL3LOG_H
-class AliL3Log{
+class AliL3Log {
public:
enum TLogLevel { kNone = 0, kDebug= 0x01, kInformational = 0x02, kWarning = 0x04, kError = 0x08 , kFatal = 0x10, kPrimary = 0x80, kAll = 0x9F };
enum TLogCmd { kEnd, kPrec, kHex, kDec };
#if __GNUC__ == 3
#define LOG( lvl, origin, keyword ) \
if (lvl>=AliL3Log::fgLevel) std::cerr<<"["<<origin<<": "<<keyword<<"] "
-//#define LOG( lvl, origin, keyword ) std::cerr<<"["<<origin<<": "<<keyword<<"] "
#define ENDLOG std::endl
#else
-//#define LOG( lvl, origin, keyword ) cerr<<"["<<origin<<": "<<keyword<<"] "
-//#define ENDLOG endl
#define LOG( lvl, origin, keyword ) \
if (lvl>=AliL3Log::fgLevel) cerr<<"["<<origin<<": "<<keyword<<"] "
#define ENDLOG endl
#ifdef use_logging
-Int_t AliL3Logger::kAll= AliL3Log::kAll;
-Int_t AliL3Logger::kDebug = AliL3Log::kDebug;
-Int_t AliL3Logger::kInformational = AliL3Log::kInformational;
-Int_t AliL3Logger::kWarning = AliL3Log::kWarning;
-Int_t AliL3Logger::kError = AliL3Log::kError;
-Int_t AliL3Logger::kFatal = AliL3Log::kFatal;
-
-AliL3Logger::AliL3Logger(){
- gLogLevel=AliL3Log::kAll;
- dn = so = se = sm =0;
- of = 0;
-}
-AliL3Logger::~AliL3Logger(){
- if(dn) {gLog.DelServer(dn);delete dn;}
- if(so) {gLog.DelServer(so);delete so;}
- if(se) {gLog.DelServer(se);delete se;}
- if(sm) {gLog.DelServer(sm);delete sm;}
- if(of) {of->close();delete of;}
-}
-void AliL3Logger::Set(Int_t l){gLogLevel |=l;}
-void AliL3Logger::UnSet(Int_t l){gLogLevel &=(~l);}
-void AliL3Logger::UseDevNull(){
- if(dn) return;
- dn = new AliL3DevNullLogServer();
+Int_t AliL3Logger::fgAll= AliL3Log::kAll;
+Int_t AliL3Logger::fgDebug = AliL3Log::kDebug;
+Int_t AliL3Logger::fgInformational = AliL3Log::kInformational;
+Int_t AliL3Logger::fgWarning = AliL3Log::kWarning;
+Int_t AliL3Logger::fgError = AliL3Log::kError;
+Int_t AliL3Logger::fgFatal = AliL3Log::kFatal;
+
+AliL3Logger::AliL3Logger()
+{
+ //constructor
+ gLogLevel=AliL3Log::fgAll;
+ fdn = fso = fse = fsm =0;
+ fof = 0;
+}
+
+AliL3Logger::~AliL3Logger()
+{
+ //destructor
+ if(fdn) {gLog.DelServer(fdn);delete fdn;}
+ if(fso) {gLog.DelServer(fso);delete fso;}
+ if(fse) {gLog.DelServer(fse);delete fse;}
+ if(fsm) {gLog.DelServer(fsm);delete fsm;}
+ if(fof) {fof->close();delete fof;}
+}
+
+void AliL3Logger::Set(Int_t l)
+{
+ //set logger
+ gLogLevel |=l;
+}
+
+void AliL3Logger::UnSet(Int_t l)
+{
+ //unset logger
+ gLogLevel &=(~l);
+}
+
+void AliL3Logger::UseDevNull()
+{
+ //use dev null
+ if(fdn) return;
+ fdn = new AliL3DevNullLogServer();
gLog.AddServer(dn);
}
-void AliL3Logger::UseStdout(){
- if(so)return;
- so = new AliL3StdoutLogServer();
- gLog.AddServer(so);
-}
-void AliL3Logger::UseStderr(){
- if(se) return;
- se = new AliL3StderrLogServer();
- gLog.AddServer(se);
-}
-
-void AliL3Logger::UseStream(Char_t *name){
- if(sm) return;
- if(of) of->close();
- delete of;
- of = 0;
- of = new ofstream();
- of->open(name);
- sm = new AliL3StreamLogServer(*of);
- gLog.AddServer(sm);
-}
-void AliL3Logger::NotUseDevNull(){
- if(dn) {gLog.DelServer(dn);delete dn;dn=0;}
-}
-void AliL3Logger::NotUseStdout(){
- if(so) {gLog.DelServer(so);delete so;so=0;}
-}
-void AliL3Logger::NotUseStderr(){
- if(se) {gLog.DelServer(se);delete se;se=0;}
-}
-
-void AliL3Logger::NotUseStream(){
- if(sm) {gLog.DelServer(sm);delete sm;sm=0;}
- if(of) {of->close();delete of;of=0;}
-}
-#else
-
-Int_t AliL3Logger::kAll= AliL3Log::kAll;
-Int_t AliL3Logger::kDebug = AliL3Log::kDebug;
-Int_t AliL3Logger::kInformational = AliL3Log::kInformational;
-Int_t AliL3Logger::kWarning = AliL3Log::kWarning;
-Int_t AliL3Logger::kError = AliL3Log::kError;
-Int_t AliL3Logger::kFatal = AliL3Log::kFatal;
-
-AliL3Logger::AliL3Logger(){;}
-AliL3Logger::~AliL3Logger(){;}
-void AliL3Logger::Set(Int_t /*l*/){;}
-void AliL3Logger::UnSet(Int_t /*l*/){;}
-void AliL3Logger::UseDevNull(){;}
-void AliL3Logger::UseStdout(){;}
-void AliL3Logger::UseStderr(){;}
-void AliL3Logger::UseStream(Char_t */*name*/){;}
-void AliL3Logger::NotUseDevNull(){;}
-void AliL3Logger::NotUseStdout(){;}
-void AliL3Logger::NotUseStderr(){;}
-void AliL3Logger::NotUseStream(){;}
+void AliL3Logger::UseStdout()
+{
+ //use stdout
+ if(fso)return;
+ fso = new AliL3StdoutLogServer();
+ gLog.AddServer(fso);
+}
+void AliL3Logger::UseStderr()
+{
+ //use stderr
+ if(fse) return;
+ fse = new AliL3StderrLogServer();
+ gLog.AddServer(fse);
+}
+
+void AliL3Logger::UseStream(Char_t *name)
+{
+ //use stream
+ if(fsm) return;
+ if(fof) fof->close();
+ delete fof;
+ fof = 0;
+ fof = new ofstream();
+ fof->open(name);
+ fsm = new AliL3StreamLogServer(*fof);
+ gLog.AddServer(fsm);
+}
+
+void AliL3Logger::NotUseDevNull()
+{
+ //not dev null
+ if(fdn) {gLog.DelServer(fdn);delete fdn;fdn=0;}
+}
+
+void AliL3Logger::NotUseStdout()
+{
+ //not stdout
+ if(fso) {gLog.DelServer(fso);delete fso;fso=0;}
+}
+
+void AliL3Logger::NotUseStderr()
+{
+ //not stderr
+ if(fse) {gLog.DelServer(fse);delete fse;fse=0;}
+}
+
+void AliL3Logger::NotUseStream()
+{
+ //not stream
+ if(fsm) {gLog.DelServer(fsm);delete fsm;fsm=0;}
+ if(fof) {fof->close();delete fof;fof=0;}
+}
+
+#else /*not use_logging*/
+
+Int_t AliL3Logger::fgAll= AliL3Log::kAll;
+Int_t AliL3Logger::fgDebug = AliL3Log::kDebug;
+Int_t AliL3Logger::fgInformational = AliL3Log::kInformational;
+Int_t AliL3Logger::fgWarning = AliL3Log::kWarning;
+Int_t AliL3Logger::fgError = AliL3Log::kError;
+Int_t AliL3Logger::fgFatal = AliL3Log::kFatal;
+
+AliL3Logger::AliL3Logger()
+{
+ //
+ ;
+}
+
+AliL3Logger::~AliL3Logger()
+{
+ //
+ ;
+}
+
+void AliL3Logger::Set(Int_t /*l*/)
+{
+ //
+ ;
+}
+
+void AliL3Logger::UnSet(Int_t /*l*/)
+{
+ //
+ ;
+}
+
+void AliL3Logger::UseDevNull()
+{
+ //
+ ;
+}
+
+void AliL3Logger::UseStdout()
+{
+ //
+ ;
+}
+
+void AliL3Logger::UseStderr()
+{
+ //
+ ;
+}
+
+void AliL3Logger::UseStream(Char_t */*name*/)
+{
+ //
+ ;
+}
+
+void AliL3Logger::NotUseDevNull()
+{
+ //
+ ;
+}
+
+void AliL3Logger::NotUseStdout()
+{
+ //
+ ;
+}
+
+void AliL3Logger::NotUseStderr()
+{
+ //
+ ;
+}
+
+void AliL3Logger::NotUseStream()
+{
+ //
+ ;
+}
#endif
class MLUCLogServer;
-class AliL3Logger{
- public:
- static Int_t kAll;
- static Int_t kDebug;
- static Int_t kInformational;
- static Int_t kWarning;
- static Int_t kError;
- static Int_t kFatal;
+class AliL3Logger {
+
+ public:
+
AliL3Logger();
virtual ~AliL3Logger();
+
void Set(Int_t l);
void UnSet(Int_t l);
void UseDevNull();
void NotUseStdout();
void NotUseStderr();
void NotUseStream();
- private:
- MLUCLogServer *dn; //!
- MLUCLogServer *so; //!
- MLUCLogServer *se; //!
- MLUCLogServer *sm; //!
+
+ protected:
+
+ static Int_t fgAll; //level all
+ static Int_t fgDebug; //level debug
+ static Int_t fgInformational; //level info
+ static Int_t fgWarning; //level warning
+ static Int_t fgError; //level error
+ static Int_t fgFatal; //level fatal
+
+ private:
+
+ MLUCLogServer *fdn; //!
+ MLUCLogServer *fso; //!
+ MLUCLogServer *fse; //!
+ MLUCLogServer *fsm; //!
#if __GNUC__ == 3
- std::ofstream *of; //!
+ std::ofstream *fof; //!
#else
- ofstream *of; //!
+ ofstream *fof; //!
#endif
ClassDef(AliL3Logger,1)
ClassImp(AliL3MemHandler)
AliL3MemHandler::AliL3MemHandler()
-{
+{
//Constructor
-
fPt = 0;
fSize =0;
fInBinary = 0;
fOutBinary = 0;
fNRandom = 0;
Init(0,0);
- IsRandom = kFALSE;
- fDigits = 0;
+ fIsRandom = kFALSE;
+ fRandomDigits = 0;
fDPt =0;
fNGenerate = 0;
fNUsed = 0;
{
//Destructor
if(fPt) delete[] fPt;
- if(fDigits) delete [] fDigits;
+ if(fRandomDigits) delete [] fRandomDigits;
if(fDPt) delete [] fDPt;
}
void AliL3MemHandler::Init(Int_t s,Int_t p, Int_t *r)
{
+ //init handler
fSlice=s;fPatch=p;
if(r) {
fRowMin=r[0];
void AliL3MemHandler::ResetROI()
{
//Resets the Look-up table for Region of Interest mode.
-
for(Int_t i=fRowMin; i<=fRowMax; i++)
{
fEtaMinTimeBin[i] = 0;
Bool_t AliL3MemHandler::SetBinaryInput(char *name)
{
//Set the input binary file.
-
fInBinary = fopen(name,"r");
if(!fInBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::SetBinaryInput","File Open")
Bool_t AliL3MemHandler::SetBinaryInput(FILE *file)
{
//Set the input binary file.
-
fInBinary = file;
if(!fInBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::SetBinaryInput","File Open")
void AliL3MemHandler::CloseBinaryInput()
{
//Close the input file.
-
if(!fInBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::CloseBinaryInput","File Close")
<<"Nothing to Close"<<ENDLOG;
Bool_t AliL3MemHandler::SetBinaryOutput(FILE *file)
{
//Set the binary output file.
-
- fOutBinary = file;
+ fOutBinary = file;
if(!fOutBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::SetBinaryOutput","File Open")
<<"Pointer to File = 0x0 "<<ENDLOG;
void AliL3MemHandler::CloseBinaryOutput()
{
+ //close binary
if(!fOutBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::CloseBinaryOutPut","File Close")
<<"Nothing to Close"<<ENDLOG;
UInt_t AliL3MemHandler::GetFileSize()
{
//Returns the file size in bytes of the input file.
-
if(!fInBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::GetFileSize","File")
<<"No Input File"<<ENDLOG;
Byte_t *AliL3MemHandler::Allocate()
{
+ //Allocate
return Allocate(GetFileSize());
}
Byte_t *AliL3MemHandler::Allocate(AliL3TrackArray *array)
{
//Allocate memory for tracks in memory. Used by TrackArray2Binary()
-
if(!array){
LOG(AliL3Log::kWarning,"AliL3MemHandler::Allocate","Memory")
<<"Pointer to AliL3TrackArray = 0x0 "<<ENDLOG;
Byte_t *AliL3MemHandler::Allocate(UInt_t size)
{
//Allocate memory of size in bytes.
-
if(fPt){
LOG(AliL3Log::kWarning,"AliL3MemHandler::Allocate","Memory")
<<"Delete Memory"<<ENDLOG;
void AliL3MemHandler::Free()
{
//Clear the memory, if allocated.
-
if(!fPt){
LOG(AliL3Log::kInformational,"AliL3MemHandler::Free","Memory")
<<"No Memory allocated - can't Free"<<ENDLOG;
{
//If you are adding random data to the original data.
- IsRandom = kTRUE;
+ fIsRandom = kTRUE;
fNRandom = maxnumber;
fNDigits = 0;
- if(fDigits) delete [] fDigits;
- fDigits = new AliL3RandomDigitData[fNRandom*9];
+ if(fRandomDigits) delete [] fRandomDigits;
+ fRandomDigits = new AliL3RandomDigitData[fNRandom*9];
if(fDPt) delete [] fDPt;
fDPt = new AliL3RandomDigitData *[fNRandom*9];
}
-void AliL3MemHandler::QSort(AliL3RandomDigitData **a, Int_t first, Int_t last){
+void AliL3MemHandler::QSort(AliL3RandomDigitData **a, Int_t first, Int_t last)
+{
// Sort array of AliL3RandomDigitData pointers using a quicksort algorithm.
// Uses CompareDigits() to compare objects.
}
}
-UInt_t AliL3MemHandler::GetRandomSize()
+UInt_t AliL3MemHandler::GetRandomSize() const
{
+ //get random size
Int_t nrandom = 0;
for(Int_t r=fRowMin;r<=fRowMax;r++){
Int_t npad=AliL3Transform::GetNPads(r);
void AliL3MemHandler::Generate(Int_t row)
{
- //Generate random data on row, if you didn't ask for this, nothing happens here.
+ //Generate random data on row, if you didn't
+ //ask for this, nothing happens here.
- if(!IsRandom) return;
+ if(!fIsRandom) return;
ResetRandom();
fNDigits = 0;
Int_t npad=AliL3Transform::GetNPads(row);
DigitizePoint(row,pad,time,charge);
}
QSort(fDPt,0,fNDigits);
- // for(Int_t d=0;d<fNDigits;d++)
- // fprintf(stderr,"%d %d %d %d\n",fDPt[d]->fRow,fDPt[d]->fPad,
- // fDPt[d]->fTime,fDPt[d]->fCharge);
}
if(dpad<0||dpad>=AliL3Transform::GetNPads(row)) continue;
if(dtime<0||dtime>=AliL3Transform::GetNTimeBins()) continue;
- fDigits[fNDigits].fCharge = dcharge;
- fDigits[fNDigits].fRow = row;
- fDigits[fNDigits].fPad = dpad;
- fDigits[fNDigits].fTime = dtime;
- fDPt[fNDigits] = &fDigits[fNDigits];
+ fRandomDigits[fNDigits].fCharge = dcharge;
+ fRandomDigits[fNDigits].fRow = row;
+ fRandomDigits[fNDigits].fPad = dpad;
+ fRandomDigits[fNDigits].fTime = dtime;
+ fDPt[fNDigits] = &fRandomDigits[fNDigits];
fNDigits++;
}
}
}
void AliL3MemHandler::AddData(AliL3DigitData *data,UInt_t & ndata,
- UInt_t /*row*/,UShort_t pad,UShort_t time,UShort_t charge)
+ UInt_t /*row*/,UShort_t pad,UShort_t time,UShort_t charge) const
{
+ //add some data
data[ndata].fPad = pad;
data[ndata].fTime = time;
data[ndata].fCharge = charge;
void AliL3MemHandler::AddRandom(AliL3DigitData *data, UInt_t & ndata)
{
+ //add some random data
data[ndata].fPad = fDPt[fNUsed]->fPad;
data[ndata].fTime = fDPt[fNUsed]->fTime;
data[ndata].fCharge = fDPt[fNUsed]->fCharge;
void AliL3MemHandler::MergeDataRandom(AliL3DigitData *data, UInt_t & ndata,
UInt_t row, UShort_t pad, UShort_t time, UShort_t charge)
{
+ //merge random data
data[ndata].fPad = pad;
data[ndata].fTime = time;
data[ndata].fCharge = charge;
void AliL3MemHandler::AddDataRandom(AliL3DigitData *data, UInt_t & ndata,
UInt_t row, UShort_t pad, UShort_t time, UShort_t charge)
{
+ //add data random
Int_t action;
while((action=ComparePoints(row,pad,time))==1){
AddRandom(data,ndata);
}
void AliL3MemHandler::Write(UInt_t *comp, UInt_t & index,
- UInt_t & subindex, UShort_t value)
+ UInt_t & subindex, UShort_t value) const
{
+ //write compressed data
UInt_t shift[3] = {0,10,20};
if(subindex==0) comp[index] =0; //clean up memory
comp[index] |= (value&0x03ff)<<shift[subindex];
else subindex++;
}
-UShort_t AliL3MemHandler::Read(UInt_t *comp, UInt_t & index, UInt_t & subindex)
-{
+UShort_t AliL3MemHandler::Read(UInt_t *comp, UInt_t & index, UInt_t & subindex) const
+{
+ //read compressed data
UInt_t shift[3] = {0,10,20};
UShort_t value = (comp[index]>>shift[subindex])&0x03ff;
if(subindex == 2){
}
UShort_t AliL3MemHandler::Test(UInt_t *comp,
- UInt_t index, UInt_t subindex)
+ UInt_t index, UInt_t subindex) const
{
+ //supi dupi test
UInt_t shift[3] = {0,10,20};
return (comp[index]>>shift[subindex])&0x03ff;
}
{
//Uncompress the run-length encoded data in memory pointed to by comp, and
// store it in data.
-
+
if(!comp){
LOG(AliL3Log::kWarning,"AliL3MemHandler::CompMemory2Memory","Memory")
<<"Pointer to compressed data = 0x0 "<<ENDLOG;
return outsize;
}
-UInt_t AliL3MemHandler::GetCompMemorySize(UInt_t nrow,AliL3DigitRowData *data)
+UInt_t AliL3MemHandler::GetCompMemorySize(UInt_t nrow,AliL3DigitRowData *data) const
{
//Return the size of RLE data, after compressing data.
return (index/3) * sizeof(UInt_t);
}
-UInt_t AliL3MemHandler::GetMemorySize(UInt_t nrow,UInt_t *comp){
+UInt_t AliL3MemHandler::GetMemorySize(UInt_t nrow,UInt_t *comp) const
+{
+ //get memory size
if(!comp){
LOG(AliL3Log::kWarning,"AliL3MemHandler::GetMemorySize","Memory")
<<"Pointer to compressed data = 0x0 "<<ENDLOG;
UInt_t AliL3MemHandler::GetNRow(UInt_t *comp,UInt_t size)
{
+ //get number of rows
if(!comp){
LOG(AliL3Log::kWarning,"AliL3MemHandler::GetNRow","Memory")
<<"Pointer to compressed data = 0x0 "<<ENDLOG;
AliL3DigitRowData *AliL3MemHandler::CompBinary2Memory(UInt_t & nrow)
{
// Read the RLE inputfile, unpack it and return the pointer to it.
-
AliL3MemHandler * handler = new AliL3MemHandler();
handler->SetBinaryInput(fInBinary);
UInt_t *comp =(UInt_t *)handler->Allocate();
Bool_t AliL3MemHandler::Binary2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data)
{
//Read the tracks in inputfile, and store it in data.
-
if(!fInBinary){
LOG(AliL3Log::kWarning,"AliL3MemHandler::Binary2Memory","File")
<<"No Input File"<<ENDLOG;
return kTRUE;
}
-Bool_t AliL3MemHandler::TrackArray2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array)
+Bool_t AliL3MemHandler::TrackArray2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array) const
{
//Fill the trackarray into the AliTrackSegmentData structures before writing to outputfile.
if(!data){
return kTRUE;
}
-Bool_t AliL3MemHandler::Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array)
+Bool_t AliL3MemHandler::Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array) const
{
//Fill the tracks in data into trackarray.
return kTRUE;
}
-Bool_t AliL3MemHandler::Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array,Int_t slice)
+Bool_t AliL3MemHandler::Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array,Int_t slice) const
{
//Fill the tracks in data into trackarray, and rotate the tracks to global coordinates.
class AliRunLoader;
#endif
-class AliL3MemHandler{
+class AliL3MemHandler {
private:
Byte_t *fPt;//!
- UInt_t fSize;
+ UInt_t fSize; //size of allocated data structure
AliL3RandomDigitData **fDPt;//!
- AliL3RandomDigitData *fDigits;//!
- Bool_t IsRandom;
- Int_t fNRandom;
- Int_t fNGenerate;
- Int_t fNUsed;
- Int_t fNDigits;
-
- void Write(UInt_t *comp, UInt_t & index, UInt_t & subindex, UShort_t value);
- UShort_t Read(UInt_t *comp, UInt_t & index, UInt_t & subindex);
- UShort_t Test(UInt_t *comp, UInt_t index, UInt_t subindex);
+ AliL3RandomDigitData *fRandomDigits;//!
+ Bool_t fIsRandom; //random data generated
+ Int_t fNRandom; //count random digits
+ Int_t fNGenerate; //count generated digits
+ Int_t fNUsed; //count used digits
+ Int_t fNDigits; //count digits from digitstree
+
+ void Write(UInt_t *comp, UInt_t & index, UInt_t & subindex, UShort_t value) const;
+ UShort_t Read(UInt_t *comp, UInt_t & index, UInt_t & subindex) const;
+ UShort_t Test(UInt_t *comp, UInt_t index, UInt_t subindex) const;
void DigitizePoint(Int_t row,Int_t pad, Int_t time,Int_t charge);
void QSort(AliL3RandomDigitData **a, Int_t first, Int_t last);
- Int_t ComparePoints(UInt_t row,UShort_t pad,UShort_t time);
- Int_t CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b);
+ Int_t ComparePoints(UInt_t row,UShort_t pad,UShort_t time) const ;
+ Int_t CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b) const;
void AddData(AliL3DigitData *data,UInt_t & ndata,
- UInt_t row,UShort_t pad,UShort_t time,UShort_t charge);
+ UInt_t row,UShort_t pad,UShort_t time,UShort_t charge) const;
void AddRandom(AliL3DigitData *data,UInt_t & ndata);
void MergeDataRandom(AliL3DigitData *data,UInt_t & ndata,
UInt_t row,UShort_t pad,UShort_t time,UShort_t charge);
UInt_t row,UShort_t pad,UShort_t time,UShort_t charge);
protected:
- Int_t fRowMin;
- Int_t fRowMax;
- Int_t fSlice;
- Int_t fPatch;
+ Int_t fRowMin; //min row
+ Int_t fRowMax; //max row
+ Int_t fSlice; //slice
+ Int_t fPatch; //patch
Int_t fEtaMinTimeBin[159]; //for ROI in eta only
- Int_t fEtaMaxTimeBin[159];
+ Int_t fEtaMaxTimeBin[159]; //for ROI in eta only
FILE *fInBinary;//!
FILE *fOutBinary;//!
Bool_t Binary2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data);
Bool_t TrackArray2Binary(AliL3TrackArray *array);
Bool_t Binary2TrackArray(AliL3TrackArray *array);
- Bool_t TrackArray2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array);
- Bool_t Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array);
- Bool_t Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array,Int_t slice);
+ Bool_t TrackArray2Memory(UInt_t & ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array) const;
+ Bool_t Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array) const;
+ Bool_t Memory2TrackArray(UInt_t ntrack,AliL3TrackSegmentData *data,AliL3TrackArray *array,Int_t slice) const;
//Memory Allocation
- UInt_t GetAllocatedSize(){return fSize;}
+ UInt_t GetAllocatedSize() const {return fSize;}
UInt_t GetFileSize();
- UInt_t GetMemorySize(UInt_t nrow,UInt_t *comp);
- UInt_t GetCompMemorySize(UInt_t nrow,AliL3DigitRowData *data);
- UInt_t GetRandomSize();
+ UInt_t GetMemorySize(UInt_t nrow,UInt_t *comp) const;
+ UInt_t GetCompMemorySize(UInt_t nrow,AliL3DigitRowData *data) const;
+ UInt_t GetRandomSize() const;
Byte_t *Allocate(UInt_t size);
Byte_t *Allocate(); // allocate size of Binary Input File
void Free();
//Getters:
- Int_t GetRowMin(){return fRowMin;}
- Int_t GetRowMax(){return fRowMax;}
- Int_t GetSlice(){return fSlice;}
- Int_t GetPatch(){return fPatch;}
+ Int_t GetRowMin() const {return fRowMin;}
+ Int_t GetRowMax() const {return fRowMax;}
+ Int_t GetSlice() const {return fSlice;}
+ Int_t GetPatch() const {return fPatch;}
//virtual functions:
virtual void FreeDigitsTree() {return;}
ClassDef(AliL3MemHandler,1) // Memory handler class
};
-inline Int_t AliL3MemHandler::ComparePoints(UInt_t /*row*/,UShort_t pad,UShort_t time){
+inline Int_t AliL3MemHandler::ComparePoints(UInt_t /*row*/,UShort_t pad,UShort_t time) const
+{
if(fNUsed>=fNDigits) return -2;
if(pad==fDPt[fNUsed]->fPad&&time==fDPt[fNUsed]->fTime) return 0;
return 1;
}
-inline Int_t AliL3MemHandler::CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b){
+inline Int_t AliL3MemHandler::CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b) const
+{
if(a->fPad==b->fPad && a->fTime == b->fTime) return 0;
if(a->fPad<b->fPad) return -1;
void AliL3Merger::DeleteArray()
{
+ //delete arrays
for(Int_t i=0; i<fNIn;i++)
{
if(!fInTrack[i]) continue;
}
void AliL3Merger::SetArray(Int_t nin)
-{
+{
+ //set arrays
DeleteArray();//Make sure arrays are cleaned
fNIn = nin;
}
void AliL3Merger::Reset()
-{
+{
+ //reset
for(Int_t i=0; i<fNIn;i++)
{
fInTrack[i]->Reset();
void AliL3Merger::FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr)
{
//Read tracks from shared memory (or memory)
-
AliL3TrackArray *destination = GetInTracks(fCurrentTracks);
if(Is2Global())
destination->FillTracks(ntracks, tr, fSlice);
}
void AliL3Merger::AddAllTracks()
-{
+{
+ //add all tracks
for(Int_t i=0; i<GetNIn();i++)
{
AliL3TrackArray *in = GetInTracks(i);
}
void AliL3Merger::SortGlobalTracks(AliL3Track **tracks, Int_t ntrack)
-{
+{
+ //sort global tracks
AliL3Track **tmp = new AliL3Track*[ntrack];
for(Int_t i=0;i<ntrack;i++) tmp[i] = tracks[i];
Int_t *t = new Int_t[ntrack];
delete[] tmp;
}
-
-void AliL3Merger::SortTracks(AliL3Track **tracks, Int_t ntrack)
-{
+void AliL3Merger::SortTracks(AliL3Track **tracks, Int_t ntrack) const
+{
+ //sort tracks
AliL3Track **tmp = new AliL3Track*[ntrack];
for(Int_t i=0;i<ntrack;i++) tmp[i] = tracks[i];
Int_t *t = new Int_t[ntrack];
}
void AliL3Merger::AddTrack(AliL3TrackArray *mergedtrack,AliL3Track *track)
-{
+{
+ // add tracks
AliL3Track *t[1];
t[0] = track;
MultiMerge(mergedtrack,t,1);
}
AliL3Track * AliL3Merger::MergeTracks(AliL3TrackArray *mergedtrack,AliL3Track *t0,AliL3Track *t1)
-{
+{
+ //merge tracks
AliL3Track *t[2];
t[0] = t0;
t[1] = t1;
AliL3Track * AliL3Merger::MultiMerge(AliL3TrackArray *mergedtracks,AliL3Track **tracks, Int_t ntrack)
{
- // merge the tracks!!
-
+ //multi merge the tracks
//check npoints
Int_t nps = 0;
for(Int_t i=0;i<ntrack;i++)
return newtrack;
}
-void* AliL3Merger::GetNtuple(char *varlist)
-{
+void* AliL3Merger::GetNtuple(char *varlist) const
+{
+ //get ntuple
#ifdef use_root
TNtuple* nt = new TNtuple("ntuple","ntuple",varlist);
return (void*) nt;
#endif
}
-void* AliL3Merger::GetNtuple()
-{
+void* AliL3Merger::GetNtuple() const
+{
+ //get ntuple
#ifdef use_root
TNtuple* nt = new TNtuple("ntuple","ntuple",
"dx:dy:dz:dk:dpsi:dtgl:dq:disx:disy:disz:dis:n0:n1:diff:drx:dry:drz");
#endif
}
-Bool_t AliL3Merger::WriteNtuple(char *filename, void* nt)
-{
+Bool_t AliL3Merger::WriteNtuple(char *filename, void* nt) const
+{
+ //write ntuple
#ifdef use_root
TNtuple *ntuple=(TNtuple *) nt;
TFile *f = new TFile(filename,"RECREATE");
}
void AliL3Merger::FillNtuple(void *nt,AliL3Track *innertrack,AliL3Track *outertrack)
-{
+{
+ //fill ntuple
Float_t data[17];
if(outertrack->IsPoint()&&innertrack->IsPoint())
{
}
}
-void AliL3Merger::FillNtuple(void *nt,Float_t *data)
-{
+void AliL3Merger::FillNtuple(void *nt,Float_t *data) const
+{
+ //fill ntuple
#ifdef use_root
TNtuple *ntuple = (TNtuple *) nt;
ntuple->Fill(data);
}
Double_t AliL3Merger::GetAngle(Double_t a1,Double_t a2)
-{
+{
+ //get angle
Double_t da = a1 - a2 + 4*AliL3Transform::Pi();
da = fmod(da,AliL3Transform::TwoPi());
if(da>AliL3Transform::Pi()) da = AliL3Transform::TwoPi()-da;
}
void AliL3Merger::SetParameter(Double_t maxy, Double_t maxz, Double_t maxkappa, Double_t maxpsi, Double_t maxtgl)
-{
+{
+ //set parameters for merger
fMaxY = maxy;
fMaxZ = maxz;
fMaxKappa = maxkappa;
Bool_t AliL3Merger::IsTrack(AliL3Track *innertrack,AliL3Track *outertrack)
{
-
+ //is track to be merged
if(innertrack->GetCharge()!=outertrack->GetCharge()) return kFALSE;
if( (!innertrack->IsPoint()) || (!outertrack->IsPoint()) ) return kFALSE;
if(innertrack->GetNHits()+outertrack->GetNHits()>AliL3Transform::GetNRows()) return kFALSE;
}
Bool_t AliL3Merger::IsRTrack(AliL3Track *innertrack,AliL3Track *outertrack)
-{
+{
+ //same as IsTrack
return IsTrack(innertrack,outertrack);
}
Double_t AliL3Merger::TrackDiff(AliL3Track *innertrack,AliL3Track *outertrack)
-{
+{
+ //return track difference
Double_t diff =-1;
Double_t x[4],y[4],z[4],dy[4],dz[4];
AliL3Track *tracks[2];
}
void AliL3Merger::PrintDiff(AliL3Track *innertrack,AliL3Track *outertrack)
-{
+{
+ // print difference
if(!innertrack->IsPoint()||!outertrack->IsPoint())
{
LOG(AliL3Log::kInformational,"AliL3Merger::PrintDiff","No Points")<<ENDLOG;
}
void AliL3Merger::PrintTrack(AliL3Track *track)
-{
+{
+ //print track info
fprintf(stderr,"npt: %3d pt: %.2f psi: %.2f tgl: %5.2f q: %2d\n",
track->GetNHits(),track->GetPt(),track->GetPsi(),
track->GetTgl(),track->GetCharge());
class AliL3Merger {
private:
- Double_t fMaxY;
- Double_t fMaxZ;
- Double_t fMaxKappa;
- Double_t fMaxPsi;
- Double_t fMaxTgl;
- void SetArray(Int_t nin);
- void DeleteArray();
- Char_t fTrackType;
+ Double_t fMaxY; //maxy
+ Double_t fMaxZ; //maxz
+ Double_t fMaxKappa;//maxkappa
+ Double_t fMaxPsi; //maxpsi
+ Double_t fMaxTgl; //maxtgl
+ Char_t fTrackType; //track type to merge
AliL3TrackArray **fInTrack;//!
- Int_t fNIn;
+ Int_t fNIn; //ntracks
AliL3TrackArray *fOutTrack;//!
+ void SetArray(Int_t nin);
+ void DeleteArray();
+
protected:
- Int_t fCurrentTracks;
- Int_t fSlice;
- AliL3Vertex *fVertex;//!
- Bool_t f2Global;
+ Int_t fCurrentTracks; //current number
+ Int_t fSlice; //slice
+ AliL3Vertex *fVertex; //!
+ Bool_t f2Global; //global
Bool_t Is2Global(Bool_t is){f2Global=is;return f2Global;}
void InitMerger(Int_t ntrackarrays,Char_t *tracktype="AliL3Track");
AliL3Merger();
virtual ~AliL3Merger();
- Int_t GetNIn(){return fNIn;}
+ Int_t GetNIn() const {return fNIn;}
AliL3TrackArray *GetInTracks(Int_t in){return fInTrack[in];}
AliL3TrackArray *GetOutTracks(){return fOutTrack;}
- Bool_t Is2Global(){return f2Global;}
+ Bool_t Is2Global() const {return f2Global;}
void SetVertex(AliL3Vertex *vertex){fVertex=vertex;}
void Reset();
void SetParameter(Double_t maxy=1., Double_t maxz=1., Double_t maxkappa=0.001, Double_t maxpsi=0.05, Double_t maxtgl=0.1);
void FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr); //Fill tracks in fTrackArray[fCurrentTracks]
Double_t GetAngle(Double_t a1,Double_t a2);
- void* GetNtuple();
- void* GetNtuple(char *varlist);
- Bool_t WriteNtuple(char *filename,void* nt);
- void FillNtuple(void* nt,Float_t *data);
+ void* GetNtuple() const;
+ void* GetNtuple(char *varlist) const;
+ Bool_t WriteNtuple(char *filename,void* nt) const;
+ void FillNtuple(void* nt,Float_t *data) const ;
void FillNtuple(void* nt,AliL3Track *innertrack,AliL3Track *outertrack);
void AddAllTracks();//Copy all Tracks to Output Array
void SortGlobalTracks(AliL3Track **tracks, Int_t ntrack);
- virtual void SortTracks(AliL3Track **tracks, Int_t ntrack);
+ virtual void SortTracks(AliL3Track **tracks, Int_t ntrack) const;
virtual void AddTrack(AliL3TrackArray *mergedtrack,AliL3Track *track);
virtual AliL3Track * MultiMerge(AliL3TrackArray *mergedtrack,AliL3Track **tracks, Int_t ntrack);
AliL3Track * MergeTracks(AliL3TrackArray *mergedtrack,AliL3Track *t0,AliL3Track *t1);
void Print();
void PrintDiff(AliL3Track *innertrack,AliL3Track *outertrack);
void PrintTrack(AliL3Track *track);
-// Int_t WriteTracks(Char_t *file);
-// Int_t WriteInTracks(Char_t *file);
-// Int_t WriteAllTracks(Char_t *file);
ClassDef(AliL3Merger,1) //Merging base class
};
AliL3RawDataFileHandler::AliL3RawDataFileHandler()
{
+ //constructor
fConvert=kTRUE;
fInRaw = 0;
fInRawPed = 0;
AliL3RawDataFileHandler::~AliL3RawDataFileHandler()
{
+ //destructor
FreeAll();
}
void AliL3RawDataFileHandler::FreeAll()
{
+ //free all heap
if(fInRaw) CloseRawInput();
if(fInRawPed) CloseRawPedestalsInput();
if(fMapping) CloseMappingFile();
Bool_t AliL3RawDataFileHandler::SetRawInput(Char_t *name)
{
+ //set raw input
if(fInRaw){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawInput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetRawInput(ifstream *file)
{
+ //set raw input
if(fInRaw){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawInput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
void AliL3RawDataFileHandler::CloseRawInput()
{
+ //close raw input
if(!fInRaw){
LOG(AliL3Log::kWarning,"AliL3RawDataFileHandler::CloseRawInput","File Close")
<<"Nothing to Close"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetRawOutput(Char_t *name)
{
+ //set raw output
if(fOutRaw){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawOutput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetRawOutput(ofstream *file)
{
+ //set raw output
if(fOutRaw){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawOutput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
void AliL3RawDataFileHandler::CloseRawOutput()
{
+ //close raw output
if(!fOutRaw){
LOG(AliL3Log::kWarning,"AliL3RawDataFileHandler::CloseRawOutput","File Close")
<<"Nothing to Close"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetRawPedestalsInput(Char_t *name)
{
+ //set raw pedestals
if(fInRawPed){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawPedestalsInput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetRawPedestalsInput(ifstream *file)
{
+ //set raw pedestals input
if(fInRawPed){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetRawPedestalsInput","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
void AliL3RawDataFileHandler::CloseRawPedestalsInput()
{
+ //close raw pedestals input
if(!fInRawPed){
LOG(AliL3Log::kWarning,"AliL3RawDataFileHandler::CloseRawPedestalsInput","File Close")
<<"Nothing to Close"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetMappingFile(Char_t *name)
{
+ //set mapping file
if(fMapping){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetMapping","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
Bool_t AliL3RawDataFileHandler::SetMappingFile(FILE *file)
{
+ //set mapping file
if(fMapping){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::SetMapping","File Open")
<<"File ptr is already in use, close file first"<<ENDLOG;
void AliL3RawDataFileHandler::CloseMappingFile()
{
+ //close mapping file
if(!fMapping){
LOG(AliL3Log::kWarning,"AliL3RawDataFileHandler::CloseMappingFile","File Close")
<<"Nothing to Close"<<ENDLOG;
Int_t AliL3RawDataFileHandler::ReadMappingFile()
{
+ //read mapping file
if(!fMapping){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::ReadMappingFile","File Open")
<<"Pointer to file = 0x0"<<ENDLOG;
return fNChannels;
}
-inline Int_t AliL3RawDataFileHandler::Convert4(Int_t i)
-{ //BigEndian i0i1i2i3 -> LittleEndian i3i2i1i0
+inline Int_t AliL3RawDataFileHandler::Convert4(Int_t i) const
+{
+ //BigEndian i0i1i2i3 -> LittleEndian i3i2i1i0
if(!fConvert) return i;
Char_t *p=(Char_t*)&i;
Char_t temp[4];
return (*(Int_t*)temp);
}
-inline Short_t AliL3RawDataFileHandler::Convert2(Short_t s)
-{ //BigEndian i0i1 -> LittleEndian i1i0
+inline Short_t AliL3RawDataFileHandler::Convert2(Short_t s) const
+{
+ //BigEndian i0i1 -> LittleEndian i1i0
if(!fConvert) return s;
Char_t *p=(Char_t*)&s;
Char_t temp[2];
Short_t** AliL3RawDataFileHandler::GetRawData(Int_t &channels, Int_t &timebins)
{
+ //get raw data
Short_t **charges=0;
channels=0;
timebins=0;
Int_t AliL3RawDataFileHandler::StoreRawData(Short_t **charges)
{
//store charges in the raw data format
-
if(!fOutRaw){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::StoreRawData","File Open")
<<"No Output avalible: no object ofstream"<<ENDLOG;
Int_t AliL3RawDataFileHandler::ReadRawPedestalsInput()
{
+ //read raw pedestals input
if(!fInRawPed){
LOG(AliL3Log::kError,"AliL3RawDataFileHandler::ReadRawPedestalsInput","File Open")
<<"No Input avalible: no object ifstream"<<ENDLOG;
AliL3DigitRowData * AliL3RawDataFileHandler::RawData2Memory(UInt_t &nrow,Int_t /*event*/)
{
+ //convert raw data to memory
AliL3DigitRowData *data = 0;
nrow=0;
return 0;
}
}
-
//get data size
Int_t nrows=0;
Bool_t AliL3RawDataFileHandler::RawData2CompBinary(Int_t event)
{
+ //raw data to binary
Bool_t out = kTRUE;
UInt_t ndigits=0;
AliL3DigitRowData *digits=0;
#include "AliL3MemHandler.h"
-class AliL3RawDataFileHandler:public AliL3MemHandler{
+class AliL3RawDataFileHandler:public AliL3MemHandler {
private:
FILE *fMapping;//!
ofstream *fOutRaw;//!
//found in mapping file
- UInt_t fNChannels;
+ UInt_t fNChannels; //number of channels
Byte_t *fRow;//! //store the channeln to row mapping
Byte_t *fPad;//! //store the channel to pad mapping
Short_t **fRowPad;//! //store the row-and-pad to channel mapping
Int_t fNTimeBins; //stored in data header
Short_t **fPedestals;//! pedestal values, if not used, fPedVal is used
- Short_t fPedVal;
+ Short_t fPedVal; //ped val if not used per channel
Short_t **fCharges;//! charge values read from pointer or from file
- Bool_t fConvert;
- Int_t Convert4(Int_t i); //big2little and vice versa
- Short_t Convert2(Short_t i); //big2little and vice versa
+ Bool_t fConvert; //convert big/little
+ Int_t Convert4(Int_t i) const; //big2little and vice versa
+ Short_t Convert2(Short_t i) const; //big2little and vice versa
public:
AliL3RawDataFileHandler();
void SetBig2Little(Bool_t b){fConvert=b;}
void SetPedVal(Short_t val){fPedVal=val;}
- Int_t GetRowMinUsed(){return fRowMinUsed;} //smallest row number used in the test
- Int_t GetRowMaxUsed(){return fRowMaxUsed;} //hightest row number used in the test
- Int_t GetPadMinUsed(){return fPadMinUsed;}
- Int_t GetPadMaxUsed(){return fPadMaxUsed;}
- Short_t GetPedVal(){return fPedVal;}
- Int_t GetNChannels(){return fNChannels;}
+ Int_t GetRowMinUsed() const {return fRowMinUsed;} //smallest row number used in the test
+ Int_t GetRowMaxUsed() const {return fRowMaxUsed;} //hightest row number used in the test
+ Int_t GetPadMinUsed() const {return fPadMinUsed;}
+ Int_t GetPadMaxUsed() const {return fPadMaxUsed;}
+ Short_t GetPedVal() const {return fPedVal;}
+ Int_t GetNChannels() const {return fNChannels;}
AliL3DigitRowData* RawData2Memory(UInt_t &nrow,Int_t event=-1);
Bool_t RawData2CompBinary(Int_t event=-1);
fPID = 0;
}
-void AliL3Track::Set(AliL3Track *tpt){
-
+void AliL3Track::Set(AliL3Track *tpt)
+{
+ //setter
SetRowRange(tpt->GetFirstRow(),tpt->GetLastRow());
SetPhi0(tpt->GetPhi0());
SetKappa(tpt->GetKappa());
Int_t AliL3Track::Compare(const AliL3Track *track) const
{
+ // compare tracks
if(track->GetNHits() < GetNHits()) return 1;
if(track->GetNHits() > GetNHits()) return -1;
return 0;
}
Double_t AliL3Track::GetPseudoRapidity() const
-{
+{ //get pseudo rap
return 0.5 * log((GetP() + GetPz()) / (GetP() - GetPz()));
}
*/
Double_t AliL3Track::GetRapidity() const
-{
+{
+ //get rap
const Double_t m_pi = 0.13957;
return 0.5 * log((m_pi + GetPz()) / (m_pi - GetPz()));
}
//If flag tolocal is set, the track is rotated
//to local coordinates.
-
Float_t psi[1] = {GetPsi()};
if(!tolocal)
AliL3Transform::Local2GlobalAngle(psi,slice);
fIsLocal=kTRUE;
}
-void AliL3Track::CalculateHelix(){
+void AliL3Track::CalculateHelix()
+{
//Calculate Radius, CenterX and CenterY from Psi, X0, Y0
- //
-
fRadius = fPt / (AliL3Transform::GetBFieldValue());
if(fRadius) fKappa = -fQ*1./fRadius;
else fRadius = 999999; //just zero
}
-Bool_t AliL3Track::CalculateReferencePoint(Double_t angle,Double_t radius){
+Bool_t AliL3Track::CalculateReferencePoint(Double_t angle,Double_t radius)
+{
// Global coordinate: crossing point with y = ax+ b;
// a=tan(angle-AliL3Transform::PiHalf());
//
return IsPoint(kTRUE);
}
-Bool_t AliL3Track::CalculateEdgePoint(Double_t angle){
+Bool_t AliL3Track::CalculateEdgePoint(Double_t angle)
+{
// Global coordinate: crossing point with y = ax; a=tan(angle);
//
Double_t rmin=AliL3Transform::Row2X(AliL3Transform::GetFirstRow(-1)); //min Radius of TPC
return IsPoint(kTRUE);
}
-Bool_t AliL3Track::CalculatePoint(Double_t xplane){
+Bool_t AliL3Track::CalculatePoint(Double_t xplane)
+{
// Local coordinate: crossing point with x plane
//
Double_t racine = pow(fRadius,2)-pow(xplane-fCenterX,2);
closest_z = GetFirstPointZ() - s_tot*GetTgl();
}
-
private:
- Int_t fNHits;
-
+ Int_t fNHits; //Number of hits
Int_t fMCid; //Assigned id from MC data.
Double_t fKappa; // Signed curvature (projected to a circle)
Double_t fPt; //transverse momentum
Double_t fLength; //length of track (s)
- Double_t fPterr;
- Double_t fPsierr;
- Double_t fZ0err;
- Double_t fTanlerr;
+ Double_t fPterr; //errors for fast hough
+ Double_t fPsierr; //errors for fast hough
+ Double_t fZ0err; //errors for fast hough
+ Double_t fTanlerr; //errors for fast hough
Double_t fPhi0; //azimuthal angle of the first point
Double_t fR0; //radius of the first point
Double_t fZ0; //z coordinate of the first point (fFirstPoint[2])
- Double_t fFirstPoint[3];
- Double_t fLastPoint[3];
- Double_t fPoint[3];
+ Double_t fFirstPoint[3]; //first point
+ Double_t fLastPoint[3]; //last point
+ Double_t fPoint[3]; //point
Double_t fPointPsi; //azimuthal angle of the momentum at Point
-
- Bool_t fIsPoint; //Helix crosses the X-plane
- Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
-
+ Bool_t fIsPoint; //Helix crosses the X-plane
Bool_t fIsLocal; //Track given in local coordinates.
- UInt_t fHitNumbers[159]; //Array of hit numbers for this track
+ Float_t fPID; //pid
+ UInt_t fHitNumbers[159]; //Array of hit numbers for this track
+
+ Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
- Float_t fPID;
public:
AliL3Track();
Double_t GetDistance(Double_t /*x0*/,Double_t /*x1*/){return 0;}
void UpdateToFirstPoint();
- Float_t GetPID() {return fPID;}
+ Float_t GetPID() const {return fPID;}
void SetPID(Float_t pid) {fPID=pid;}
void GetClosestPoint(AliL3Vertex *vertex,Double_t &closest_x,Double_t &closest_y,Double_t &closest_z);
void Rotate(Int_t slice,Bool_t tolocal=kFALSE);
- Bool_t IsLocal() {return fIsLocal;}
+ Bool_t IsLocal() const {return fIsLocal;}
// getter
- Double_t GetFirstPointX() {return fFirstPoint[0];}
- Double_t GetFirstPointY() {return fFirstPoint[1];}
- Double_t GetFirstPointZ() {return fFirstPoint[2];}
- Double_t GetLastPointX() {return fLastPoint[0];}
- Double_t GetLastPointY() {return fLastPoint[1];}
- Double_t GetLastPointZ() {return fLastPoint[2];}
-
- Double_t GetPointPsi() {return fPointPsi;}
- Double_t GetPointX() {return fPoint[0];}
- Double_t GetPointY() {return fPoint[1];}
- Double_t GetPointZ() {return fPoint[2];}
+ Double_t GetFirstPointX() const {return fFirstPoint[0];}
+ Double_t GetFirstPointY() const {return fFirstPoint[1];}
+ Double_t GetFirstPointZ() const {return fFirstPoint[2];}
+ Double_t GetLastPointX() const {return fLastPoint[0];}
+ Double_t GetLastPointY() const {return fLastPoint[1];}
+ Double_t GetLastPointZ() const {return fLastPoint[2];}
+
+ Double_t GetPointPsi() const {return fPointPsi;}
+ Double_t GetPointX() const {return fPoint[0];}
+ Double_t GetPointY() const {return fPoint[1];}
+ Double_t GetPointZ() const {return fPoint[2];}
Double_t GetPt() const {return fPt;}
Double_t GetTgl() const {return fTanl;}
Double_t GetPhi0() const {return fPhi0;}
Double_t GetR0() const {return fR0;}
Double_t GetZ0() const {return fFirstPoint[2];}
- //Double_t GetZ0() const {return fZ0;}
+ //const Double_t GetZ0() const {return fZ0;}
Double_t GetKappa() const {return fKappa;}
Double_t GetRadius() const {return fRadius;}
};
#endif
-
ClassImp(AliL3TrackArray)
-AliL3TrackArray::AliL3TrackArray(){
+AliL3TrackArray::AliL3TrackArray()
+{
//Default constructor
fSize = 0;
fNTracks=0;
}
-AliL3TrackArray::AliL3TrackArray(Int_t ntrack){
+AliL3TrackArray::AliL3TrackArray(Int_t ntrack)
+{
//Constructor.
fSize = 0;
fNTracks=0;
SetSize(ntrack);
}
-AliL3TrackArray::AliL3TrackArray(char* tracktype,Int_t ntrack){
+AliL3TrackArray::AliL3TrackArray(char* tracktype,Int_t ntrack)
+{
//Constructor.
fSize = 0;
fNTracks=0;
SetSize(ntrack);
}
-AliL3TrackArray::AliL3TrackArray(char* tracktype){
+AliL3TrackArray::AliL3TrackArray(char* tracktype)
+{
//Constructor.
fSize = 0;
fNTracks=0;
SetSize();
}
-AliL3TrackArray::~AliL3TrackArray(){
+AliL3TrackArray::~AliL3TrackArray()
+{
//Destructor
DeleteArray();
}
-AliL3Track *AliL3TrackArray::NextTrack(){
+AliL3Track *AliL3TrackArray::NextTrack()
+{
+ //next track in array
if(fNTracks<fSize) return fTrack[fNTracks++];
SetSize(fSize+100);
return fTrack[fNTracks++];
}
-void AliL3TrackArray::DeleteArray(){
+void AliL3TrackArray::DeleteArray()
+{
+ //delete array
for(Int_t i=0; i<fSize;i++)
delete fTrack[i];
delete[] fIsPresent;
delete[] fTrack;
}
-Bool_t AliL3TrackArray::SetSize(Int_t newsize){
+Bool_t AliL3TrackArray::SetSize(Int_t newsize)
+{
+ //set size
if(newsize<=fSize) return kFALSE; //shrink comes later!!
if(!fSize){
fSize = newsize;
return kTRUE;
}
-void AliL3TrackArray::Reset(){
+void AliL3TrackArray::Reset()
+{
+ //reset
fNTracks=0;
fNAbsent=0;
for(Int_t i=0; i<fSize;i++)
fIsPresent[i] = kTRUE;
}
-void AliL3TrackArray::Remove(Int_t track){
+void AliL3TrackArray::Remove(Int_t track)
+{
+ //remove track
if(fIsPresent[track]){
fIsPresent[track]=kFALSE;
fNAbsent++;
}
}
-void AliL3TrackArray::FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr,Int_t slice){
+void AliL3TrackArray::FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr,Int_t slice)
+{
//Read tracks from shared memory (or memory)
AliL3TrackSegmentData *trs = tr;
for(Int_t i=0; i<ntracks; i++){
}
}
-UInt_t AliL3TrackArray::GetOutSize(){
+UInt_t AliL3TrackArray::GetOutSize()
+{
+ //get size for IO
UInt_t count = GetOutCount(); //use only present tracks
UInt_t tHits = 0;
for(Int_t i=0;i<fNTracks;i++){ //loop over all tracks
return count*sizeof(AliL3TrackSegmentData)+sizeof(UInt_t)*tHits;
}
-UInt_t AliL3TrackArray::WriteTracks(UInt_t & ntracks,AliL3TrackSegmentData* tr){
+UInt_t AliL3TrackArray::WriteTracks(UInt_t & ntracks,AliL3TrackSegmentData* tr)
+{
+ //write tracks
ntracks = GetOutCount();
return WriteTracks(tr);
}
-UInt_t AliL3TrackArray::WriteTracks(AliL3TrackSegmentData* tr){
+UInt_t AliL3TrackArray::WriteTracks(AliL3TrackSegmentData* tr)
+{
//if(GetTrackType()=='c') return WriteConfMapTracks(tr);
AliL3TrackSegmentData *tP = tr;
UInt_t *pP;
return size;
}
-UInt_t AliL3TrackArray::WriteConfMapTracks(AliL3TrackSegmentData* tr){
+UInt_t AliL3TrackArray::WriteConfMapTracks(AliL3TrackSegmentData* tr)
+{
// use first and last point objects
AliL3TrackSegmentData *tP = tr;
UInt_t *pP;
for(Int_t i=0; i<fNTracks; i++){ //loop over all tracks
AliL3ConfMapTrack *track =(AliL3ConfMapTrack *) GetCheckedTrack(i); //use only present tracks
if(!track) continue; //use only present tracks
- AliL3ConfMapPoint *hit = (AliL3ConfMapPoint*)track->lastHit;
- AliL3ConfMapPoint *lastHit = (AliL3ConfMapPoint*)track->firstHit;
+ AliL3ConfMapPoint *hit = (AliL3ConfMapPoint*)track->GetLastHit();
+ AliL3ConfMapPoint *lastHit = (AliL3ConfMapPoint*)track->GetFirstHit();
tP->fX = hit->GetX();
tP->fY = hit->GetY();
tP->fZ = hit->GetZ();
void AliL3TrackArray::AddLast(AliL3Track *track)
{
+ //add track to last position
AliL3Track *tpt = NextTrack();
tpt->Set(track);
void AliL3TrackArray::AddTracks(AliL3TrackArray *newtrack,Bool_t remove_old,Int_t slice)
{
+ //add tracks
if(GetTrackType() != newtrack->GetTrackType() && GetTrackType()!='t')
{
LOG(AliL3Log::kError,"AliL3TrackArray::AddTracks","Track types")
}
}
-
-void AliL3TrackArray::Compress(){
+void AliL3TrackArray::Compress()
+{
+ //compress array
if(GetNPresent()==GetNTracks()) return;
AliL3Track **tmp = new AliL3Track *[fNTracks];
Int_t present=0;
fNAbsent = 0;
}
-void AliL3TrackArray::QSort(){
- // compress an sort
+void AliL3TrackArray::QSort()
+{
+ // compress and sort
Compress();
QSort(fTrack,0,fNTracks);
}
-void AliL3TrackArray::QSort( AliL3Track **a, Int_t first, Int_t last){
-
+void AliL3TrackArray::QSort( AliL3Track **a, Int_t first, Int_t last)
+{
// Sort array of AliL3Track pointers using a quicksort algorithm.
// Uses TrackCompare() to compare objects.
// Thanks to Root!
}
}
-Int_t AliL3TrackArray::TrackCompare(AliL3Track *a, AliL3Track *b){
+Int_t AliL3TrackArray::TrackCompare(AliL3Track *a, AliL3Track *b) const
+{
// Compare the two tracks.
return b->Compare(a);
class AliL3Track;
class AliL3TrackSegmentData;
-class AliL3TrackArray{
+class AliL3TrackArray {
+
private:
- void DeleteArray();
- Char_t fTrackType;
- Int_t fSize;
+ Char_t fTrackType; //track type
+ Int_t fSize; //size of arra
Bool_t *fIsPresent;//!
- Int_t fNAbsent;
+ Int_t fNAbsent; //ntracks absent
AliL3Track **fTrack;//!
- Int_t fNTracks;
+ Int_t fNTracks; //ntracks in
UInt_t WriteConfMapTracks(AliL3TrackSegmentData* tr);
+ void DeleteArray();
public:
AliL3TrackArray();
AliL3TrackArray(char* tracktype);
virtual ~AliL3TrackArray();
Int_t GetTrackType(){return fTrackType;}
- Int_t GetSize(){return fSize;}
+ Int_t GetSize() const {return fSize;}
Bool_t SetSize(Int_t newsize=2000);
- Int_t GetNPresent(){return (fNTracks- fNAbsent);}
-
- Int_t GetNTracks(){return fNTracks;}
+ Int_t GetNPresent() const {return (fNTracks- fNAbsent);}
+ Int_t GetNTracks() const {return fNTracks;}
AliL3Track *NextTrack();
AliL3Track *GetCheckedTrack(Int_t t){if(fIsPresent[t]) return fTrack[t]; return 0;}
AliL3Track *GetTrack(Int_t t){return fTrack[t];}
void Reset();
void QSort();
void QSort( AliL3Track **a, Int_t first, Int_t last);
- Int_t TrackCompare(AliL3Track *a, AliL3Track *b);
-
+ Int_t TrackCompare(AliL3Track *a, AliL3Track *b) const;
void FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr,Int_t slice); //Fill tracks and transform
void FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr); //Fill tracks
// compile with USEPACKAGE=ALIROOT set (see level3code/Makefile.conf).
//
// Currently, there are 4 versions of the Transformer:
-// fVersion==fV_aliroot: ALIROOT-head compatible
-// fVersion==fV_cosmics: Cosmics data run (2003) compatible
-// fVersion==fV_default: means no config file has been loaded
-// fVersion==fV_deprecated: dont use old (before July 2003) style of transformer
+// fVersion==kValiroot: ALIROOT-head compatible
+// fVersion==kVcosmics: Cosmics data run (2003) compatible
+// fVersion==kVdefault: means no config file has been loaded
+// fVersion==kVdeprecated: dont use old (before July 2003) style of transformer
//
</pre>
*/
ClassImp(AliL3Transform)
-const Double_t AliL3Transform::fAnodeWireSpacing = 0.25; //Taken from the TDR
-const Double_t AliL3Transform::fBFACT = 0.0029980; //Conversion Factor
-const Double_t AliL3Transform::fPi = 3.141592653589793;
-const Double_t AliL3Transform::f2Pi = 2*3.141592653589793;
-const Double_t AliL3Transform::fPi2 = 0.5*3.141592653589793;
-const Double_t AliL3Transform::fToDeg = 180/3.141592653589793;
+const Double_t AliL3Transform::fgkAnodeWireSpacing = 0.25; //Taken from the TDR
+const Double_t AliL3Transform::fgkBFACT = 0.0029980; //Conversion Factor
+const Double_t AliL3Transform::fgkPi = 3.141592653589793;
+const Double_t AliL3Transform::fgk2Pi = 2*3.141592653589793;
+const Double_t AliL3Transform::fgkPi2 = 0.5*3.141592653589793;
+const Double_t AliL3Transform::fgkToDeg = 180/3.141592653589793;
//Defined by HLT and GSI
-Int_t AliL3Transform::fNPatches = 6;
-Int_t AliL3Transform::fRows[6][2] = {{0,29},{30,62},{63,90},{91,116},{117,139},{140,158}};
-Int_t AliL3Transform::fNRows[6] = {30,33,28,26,23,19};
+Int_t AliL3Transform::fgNPatches = 6;
+Int_t AliL3Transform::fgRows[6][2] = {{0,29},{30,62},{63,90},{91,116},{117,139},{140,158}};
+Int_t AliL3Transform::fgNRows[6] = {30,33,28,26,23,19};
// The following definition is generated by MakeInitFile function
-Double_t AliL3Transform::fBField = 0.2;
-Double_t AliL3Transform::fSolenoidBField = 2;
-Double_t AliL3Transform::fBFieldFactor = 1;
-Int_t AliL3Transform::fVersion = fV_default;
-Int_t AliL3Transform::fNTimeBins = 446;
-Int_t AliL3Transform::fNRowLow = 63;
-Int_t AliL3Transform::fNRowUp = 96;
-Int_t AliL3Transform::fNRowUp1 = 64;
-Int_t AliL3Transform::fNRowUp2 = 32;
-Int_t AliL3Transform::fNSectorLow = 36;
-Int_t AliL3Transform::fNSectorUp = 36;
-Int_t AliL3Transform::fNSector = 72;
-Double_t AliL3Transform::fPadPitchWidthLow = 0.4;
-Double_t AliL3Transform::fPadPitchWidthUp = 0.6;
-Double_t AliL3Transform::fZWidth = 0.5660;
-Double_t AliL3Transform::fZSigma = 0.2288;
-Double_t AliL3Transform::fZLength = 250.0000;
-Double_t AliL3Transform::fZOffset = 0.6864;
-Double_t AliL3Transform::fDiffT = 0.0220;
-Double_t AliL3Transform::fDiffL = 0.0220;
-Double_t AliL3Transform::fOmegaTau = 0.1450;
-Double_t AliL3Transform::fInnerPadLength = 0.75;
-Double_t AliL3Transform::fOuter1PadLength = 1.00;
-Double_t AliL3Transform::fOuter2PadLength = 1.50;
-Double_t AliL3Transform::fInnerPRFSigma = 0.203811;
-Double_t AliL3Transform::fOuter1PRFSigma = 0.299325;
-Double_t AliL3Transform::fOuter2PRFSigma = 0.299323;
-Double_t AliL3Transform::fTimeSigma = 0.228809;
-Int_t AliL3Transform::fADCSat = 1024;
-Int_t AliL3Transform::fZeroSup = 0;
-Int_t AliL3Transform::fNSlice = 36;
-Int_t AliL3Transform::fNRow = 159;
-Double_t AliL3Transform::fNRotShift = 0.5;
-Int_t AliL3Transform::fSlice2Sector[36][2] = { { 0, 36},
+Double_t AliL3Transform::fgBField = 0.2;
+Double_t AliL3Transform::fgSolenoidBField = 2;
+Double_t AliL3Transform::fgBFieldFactor = 1;
+Int_t AliL3Transform::fgVersion = kVdefault;
+Int_t AliL3Transform::fgNTimeBins = 446;
+Int_t AliL3Transform::fgNRowLow = 63;
+Int_t AliL3Transform::fgNRowUp = 96;
+Int_t AliL3Transform::fgNRowUp1 = 64;
+Int_t AliL3Transform::fgNRowUp2 = 32;
+Int_t AliL3Transform::fgNSectorLow = 36;
+Int_t AliL3Transform::fgNSectorUp = 36;
+Int_t AliL3Transform::fgNSector = 72;
+Double_t AliL3Transform::fgPadPitchWidthLow = 0.4;
+Double_t AliL3Transform::fgPadPitchWidthUp = 0.6;
+Double_t AliL3Transform::fgZWidth = 0.5660;
+Double_t AliL3Transform::fgZSigma = 0.2288;
+Double_t AliL3Transform::fgZLength = 250.0000;
+Double_t AliL3Transform::fgZOffset = 0.6864;
+Double_t AliL3Transform::fgDiffT = 0.0220;
+Double_t AliL3Transform::fgDiffL = 0.0220;
+Double_t AliL3Transform::fgOmegaTau = 0.1450;
+Double_t AliL3Transform::fgInnerPadLength = 0.75;
+Double_t AliL3Transform::fgOuter1PadLength = 1.00;
+Double_t AliL3Transform::fgOuter2PadLength = 1.50;
+Double_t AliL3Transform::fgInnerPRFSigma = 0.203811;
+Double_t AliL3Transform::fgOuter1PRFSigma = 0.299325;
+Double_t AliL3Transform::fgOuter2PRFSigma = 0.299323;
+Double_t AliL3Transform::fgTimeSigma = 0.228809;
+Int_t AliL3Transform::fgADCSat = 1024;
+Int_t AliL3Transform::fgZeroSup = 0;
+Int_t AliL3Transform::fgNSlice = 36;
+Int_t AliL3Transform::fgNRow = 159;
+Double_t AliL3Transform::fgNRotShift = 0.5;
+Int_t AliL3Transform::fgSlice2Sector[36][2] = { { 0, 36},
{ 1, 37},
{ 2, 38},
{ 3, 39},
{35, 71}
};
-Int_t AliL3Transform::fSector2Slice[72] = { 0,
+Int_t AliL3Transform::fgSector2Slice[72] = { 0,
1,
2,
3,
35
};
-Int_t AliL3Transform::fSectorLow[72] = { 1,
+Int_t AliL3Transform::fgSectorLow[72] = { 1,
1,
1,
1,
0
};
-Double_t AliL3Transform::fX[159] = { 85.195,
+Double_t AliL3Transform::fgX[159] = { 85.195,
85.945,
86.695,
87.445,
245.930
};
-Int_t AliL3Transform::fNPads[159] = {67,
+Int_t AliL3Transform::fgNPads[159] = {67,
67,
69,
69,
139
};
-Double_t AliL3Transform::fCos[36] = { 0.9848077297,
+Double_t AliL3Transform::fgCos[36] = { 0.9848077297,
0.8660253882,
0.6427876353,
0.3420201540,
0.9848077297
};
-Double_t AliL3Transform::fSin[36] = { 0.1736481786,
+Double_t AliL3Transform::fgSin[36] = { 0.1736481786,
0.5000000000,
0.7660444379,
0.9396926165,
#ifdef use_aliroot
Bool_t AliL3Transform::Init(AliRunLoader *runLoader)
-{
+{
+ //init with runloader
if(!runLoader) {
LOG(AliL3Log::kFatal,"AliL3Transform::Init","RunLoader")
<<" Missing RunLoader! 0x0"<<ENDLOG;
return kFALSE;
}
- if(fVersion != fV_default)
+ if(fgVersion != kVdefault)
LOG(AliL3Log::kWarning,"AliL3Transform::Init","Init values")
- <<AliL3Log::kDec<<"You are initializing the parameters more than once; check your code please! "<<fVersion<<ENDLOG;
+ <<AliL3Log::kDec<<"You are initializing the parameters more than once; check your code please! "<<fgVersion<<ENDLOG;
TDirectory* savedir1 = gDirectory;
runLoader->CdGAFile();
param->SetOuter2PRF(prfouter2);
param->SetTimeRF(rf);
- fNTimeBins = param->GetMaxTBin()+1;
- fNRowLow = param->GetNRowLow();
- fNRowUp = param->GetNRowUp();
- fNRowUp1 = param->GetNRowUp1();
- fNRowUp2 = param->GetNRowUp2();
- fNRow= fNRowLow + fNRowUp;
- if(fNRow!=159){
+ fgNTimeBins = param->GetMaxTBin()+1;
+ fgNRowLow = param->GetNRowLow();
+ fgNRowUp = param->GetNRowUp();
+ fgNRowUp1 = param->GetNRowUp1();
+ fgNRowUp2 = param->GetNRowUp2();
+ fgNRow= fgNRowLow + fgNRowUp;
+ if(fgNRow!=159){
LOG(AliL3Log::kError,"AliL3Transform::Init","fNRow")
<<"Number of rows have changed in ALIROOT"<<ENDLOG;
return kFALSE;
}
- fNSectorLow = param->GetNInnerSector();
- fNSectorUp = param->GetNOuterSector();
- fNSector = fNSectorLow + fNSectorUp;
+ fgNSectorLow = param->GetNInnerSector();
+ fgNSectorUp = param->GetNOuterSector();
+ fgNSector = fgNSectorLow + fgNSectorUp;
//test whether they were changes to the rotation shift
- fNRotShift=0;
+ fgNRotShift=0;
Float_t irotshift = param->GetInnerAngleShift(); //shift angle
Float_t orotshift = param->GetOuterAngleShift(); //shift angle
const Float_t kDegtoRad = 0.01745329251994;
<<"Rotation shift angle has changed in ALIROOT"<<ENDLOG;
return kFALSE;
} else {
- fNRotShift=0.5; //our version of the shift angle
+ fgNRotShift=0.5; //our version of the shift angle
}
- fVersion=fV_aliroot;
+ fgVersion=kValiroot;
SetBFieldFactor((Double_t)runLoader->GetAliRun()->Field()->Factor());
SetSolenoidBField((Double_t)runLoader->GetAliRun()->Field()->SolenoidField());
- fPadPitchWidthLow=param->GetInnerPadPitchWidth();
- fPadPitchWidthUp=param->GetOuterPadPitchWidth();
- fZWidth=param->GetZWidth();
- fZSigma=param->GetZSigma();
- fZLength=param->GetZLength();
- fZOffset=param->GetZOffset();
- fDiffT=param->GetDiffT();
- fDiffL=param->GetDiffL();
- fOmegaTau=param->GetOmegaTau();
- fInnerPadLength=param->GetInnerPadLength();
- fOuter1PadLength=param->GetOuter1PadLength();
- fOuter2PadLength=param->GetOuter2PadLength();
- fInnerPRFSigma=param->GetInnerPRF()->GetSigmaX();
- fOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX();
- fOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX();
- fTimeSigma=param->GetTimeRF()->GetSigma();
- fADCSat=param->GetADCSat();
- fZeroSup=param->GetZeroSup();
- fNSlice=fNSectorLow;
+ fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
+ fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
+ fgZWidth=param->GetZWidth();
+ fgZSigma=param->GetZSigma();
+ fgZLength=param->GetZLength();
+ fgZOffset=param->GetZOffset();
+ fgDiffT=param->GetDiffT();
+ fgDiffL=param->GetDiffL();
+ fgOmegaTau=param->GetOmegaTau();
+ fgInnerPadLength=param->GetInnerPadLength();
+ fgOuter1PadLength=param->GetOuter1PadLength();
+ fgOuter2PadLength=param->GetOuter2PadLength();
+ fgInnerPRFSigma=param->GetInnerPRF()->GetSigmaX();
+ fgOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX();
+ fgOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX();
+ fgTimeSigma=param->GetTimeRF()->GetSigma();
+ fgADCSat=param->GetADCSat();
+ fgZeroSup=param->GetZeroSup();
+ fgNSlice=fgNSectorLow;
//now do the arrays
- for(Int_t i=0;i<fNRow;i++){
+ for(Int_t i=0;i<fgNRow;i++){
Int_t sec,row;
- if( i < fNRowLow){sec =0;row =i;}
- else{sec = fNSectorLow;row =i-fNRowLow;}
- fX[i]=param->GetPadRowRadii(sec,row);
+ if( i < fgNRowLow){sec =0;row =i;}
+ else{sec = fgNSectorLow;row =i-fgNRowLow;}
+ fgX[i]=param->GetPadRowRadii(sec,row);
}
- for(Int_t i=0;i<fNRow;i++){
+ for(Int_t i=0;i<fgNRow;i++){
Int_t sec,row;
- if( i < fNRowLow){sec =0;row =i;}
- else{sec = fNSectorLow;row =i-fNRowLow;}
- fNPads[i]=param->GetNPads(sec,row);
+ if( i < fgNRowLow){sec =0;row =i;}
+ else{sec = fgNSectorLow;row =i-fgNRowLow;}
+ fgNPads[i]=param->GetNPads(sec,row);
}
- for(Int_t i=0;i<fNSector;i++){
- if(i<fNSectorLow) fSectorLow[i]=1;
- else fSectorLow[i]=0;
+ for(Int_t i=0;i<fgNSector;i++){
+ if(i<fgNSectorLow) fgSectorLow[i]=1;
+ else fgSectorLow[i]=0;
}
+ return kTRUE;
+
+ /* not needed
TTimeStamp time;
Char_t tmpfile[1024];
sprintf(tmpfile,"./l3transform.config-%d",(Int_t)time.GetSec());
return SaveInitFile(tmpfile);
-
+ */
}
#endif
//If flag UseAliTPCParam is set, the parameters will be read from the the rootfile
//which then has to be called path/digitfile.root
- if(fVersion != fV_default)
+ if(fgVersion != kVdefault)
LOG(AliL3Log::kWarning,"AliL3Transform::Init","Init values")
- <<AliL3Log::kDec<<"You are initializing the parameters more than once; check your code please! "<<fVersion<<ENDLOG;
+ <<AliL3Log::kDec<<"You are initializing the parameters more than once; check your code please! "<<fgVersion<<ENDLOG;
if(UseAliTPCParam) //use rootfile to generate temporary init file
return ReadInit(path);
Bool_t AliL3Transform::ReadInitFile(Char_t* pathname)
{
//read transformer settings from pathname
-
FILE *fptr=fopen(pathname,"r");
if(!fptr){
LOG(AliL3Log::kWarning,"AliL3Transform::ReadInitFile","File Open")
while(!feof(fptr)) {
fscanf(fptr,"%s",d1);
- if(strcmp(d1,"fVersion")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fVersion=dummy;}
- else if(strcmp(d1,"fBFieldFactor")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fBFieldFactor=(Double_t)ddummy;}
+ if(strcmp(d1,"fVersion")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgVersion=dummy;}
+ else if(strcmp(d1,"fBFieldFactor")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgBFieldFactor=(Double_t)ddummy;}
else if(strcmp(d1,"fSolenoidBField")==0)
{
fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);
- fSolenoidBField=(Double_t)ddummy;
+ fgSolenoidBField=(Double_t)ddummy;
}
- else if(strcmp(d1,"fNTimeBins")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNTimeBins=(Int_t)dummy;}
+ else if(strcmp(d1,"fNTimeBins")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNTimeBins=(Int_t)dummy;}
else if(strcmp(d1,"fNRowLow")==0)
{
fscanf(fptr,"%s %d %s",d2,&dummy,d3);
- fNRowLow=(Int_t)dummy;
- if(fNRowLow != 63)
+ fgNRowLow=(Int_t)dummy;
+ if(fgNRowLow != 63)
LOG(AliL3Log::kError,"AliL3Transform::ReadInitFile","Overflow")
<<"Number of inner PadRows should be 63! Check and fgrep the code for 63 to see the consequences of this major change!"<<ENDLOG;
}
- else if(strcmp(d1,"fNRowUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp=(Int_t)dummy;}
- else if(strcmp(d1,"fNRowUp1")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp1=(Int_t)dummy;}
- else if(strcmp(d1,"fNRowUp2")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp2=(Int_t)dummy;}
- else if(strcmp(d1,"fNSectorLow")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSectorLow=(Int_t)dummy;}
- else if(strcmp(d1,"fNSectorUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSectorUp=(Int_t)dummy;}
- else if(strcmp(d1,"fNSector")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSector=(Int_t)dummy;}
- else if(strcmp(d1,"fPadPitchWidthLow")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPadPitchWidthLow=(Double_t)ddummy;}
- else if(strcmp(d1,"fPadPitchWidthUp")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPadPitchWidthUp=(Double_t)ddummy;}
- else if(strcmp(d1,"fZWidth")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZWidth=(Double_t)ddummy;}
- else if(strcmp(d1,"fZSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZSigma=(Double_t)ddummy;}
- else if(strcmp(d1,"fZLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZLength=(Double_t)ddummy;}
- else if(strcmp(d1,"fZOffset")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZOffset=(Double_t)ddummy;}
- else if(strcmp(d1,"fNSlice")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSlice=(Int_t)dummy;}
- else if(strcmp(d1,"fDiffT")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fDiffT=(Double_t)ddummy;}
- else if(strcmp(d1,"fDiffL")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fDiffL=(Double_t)ddummy;}
- else if(strcmp(d1,"fOmegaTau")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOmegaTau=(Double_t)ddummy;}
- else if(strcmp(d1,"fInnerPadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fInnerPadLength=(Double_t)ddummy;}
- else if(strcmp(d1,"fOuter1PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter1PadLength=(Double_t)ddummy;}
- else if(strcmp(d1,"fOuter2PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter2PadLength=(Double_t)ddummy;}
- else if(strcmp(d1,"fInnerPRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fInnerPRFSigma=(Double_t)ddummy;}
- else if(strcmp(d1,"fOuter1PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter1PRFSigma=(Double_t)ddummy;}
- else if(strcmp(d1,"fOuter2PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter2PRFSigma=(Double_t)ddummy;}
- else if(strcmp(d1,"fTimeSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fTimeSigma=(Double_t)ddummy;}
- else if(strcmp(d1,"fADCSat")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fADCSat=(Int_t)dummy;}
- else if(strcmp(d1,"fZeroSup")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fZeroSup=(Int_t)dummy;}
+ else if(strcmp(d1,"fNRowUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp=(Int_t)dummy;}
+ else if(strcmp(d1,"fNRowUp1")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp1=(Int_t)dummy;}
+ else if(strcmp(d1,"fNRowUp2")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRowUp2=(Int_t)dummy;}
+ else if(strcmp(d1,"fNSectorLow")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSectorLow=(Int_t)dummy;}
+ else if(strcmp(d1,"fNSectorUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSectorUp=(Int_t)dummy;}
+ else if(strcmp(d1,"fNSector")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSector=(Int_t)dummy;}
+ else if(strcmp(d1,"fPadPitchWidthLow")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgPadPitchWidthLow=(Double_t)ddummy;}
+ else if(strcmp(d1,"fPadPitchWidthUp")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgPadPitchWidthUp=(Double_t)ddummy;}
+ else if(strcmp(d1,"fZWidth")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZWidth=(Double_t)ddummy;}
+ else if(strcmp(d1,"fZSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZSigma=(Double_t)ddummy;}
+ else if(strcmp(d1,"fZLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZLength=(Double_t)ddummy;}
+ else if(strcmp(d1,"fZOffset")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgZOffset=(Double_t)ddummy;}
+ else if(strcmp(d1,"fNSlice")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNSlice=(Int_t)dummy;}
+ else if(strcmp(d1,"fDiffT")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgDiffT=(Double_t)ddummy;}
+ else if(strcmp(d1,"fDiffL")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgDiffL=(Double_t)ddummy;}
+ else if(strcmp(d1,"fOmegaTau")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOmegaTau=(Double_t)ddummy;}
+ else if(strcmp(d1,"fInnerPadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgInnerPadLength=(Double_t)ddummy;}
+ else if(strcmp(d1,"fOuter1PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter1PadLength=(Double_t)ddummy;}
+ else if(strcmp(d1,"fOuter2PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter2PadLength=(Double_t)ddummy;}
+ else if(strcmp(d1,"fInnerPRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgInnerPRFSigma=(Double_t)ddummy;}
+ else if(strcmp(d1,"fOuter1PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter1PRFSigma=(Double_t)ddummy;}
+ else if(strcmp(d1,"fOuter2PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgOuter2PRFSigma=(Double_t)ddummy;}
+ else if(strcmp(d1,"fTimeSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgTimeSigma=(Double_t)ddummy;}
+ else if(strcmp(d1,"fADCSat")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgADCSat=(Int_t)dummy;}
+ else if(strcmp(d1,"fZeroSup")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgZeroSup=(Int_t)dummy;}
else if(strcmp(d1,"fNRow")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRow=(Int_t)dummy;
- if(fNRow!=159){
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRow=(Int_t)dummy;
+ if(fgNRow!=159){
LOG(AliL3Log::kError,"AliL3Transform::ReadInitFile","Overflow")<<"Number of PadRows should be 159! Check and fgrep the code for 159 to see the consequences of this major change!"<<ENDLOG;
}
}
- else if(strcmp(d1,"fNRotShift")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fNRotShift=(Double_t)ddummy;}
+ else if(strcmp(d1,"fNRotShift")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgNRotShift=(Double_t)ddummy;}
else if(strcmp(d1,"fX[0]")==0){
- fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fX[0]=(Double_t)ddummy;
- for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fX[i]=(Double_t)ddummy;}
+ fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgX[0]=(Double_t)ddummy;
+ for(Int_t i=1;i<fgNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgX[i]=(Double_t)ddummy;}
}
else if(strcmp(d1,"fNPads[0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNPads[0]=(Int_t)dummy;
- for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fNPads[i]=(Int_t)dummy;}
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNPads[0]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNRow;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgNPads[i]=(Int_t)dummy;}
}
else if(strcmp(d1,"fNRows[0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRows[0]=(Int_t)dummy;
- for(Int_t i=1;i<fNPatches;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fNRows[i]=(Int_t)dummy;}
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgNRows[0]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNPatches;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgNRows[i]=(Int_t)dummy;}
}
else if(strcmp(d1,"fRows[0][0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fRows[0][0]=(Int_t)dummy;
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fRows[0][1]=(Int_t)dummy;
- for(Int_t i=1;i<fNPatches;i++){
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fRows[i][0]=(Int_t)dummy;
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fRows[i][1]=(Int_t)dummy;
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgRows[0][0]=(Int_t)dummy;
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[0][1]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNPatches;i++){
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[i][0]=(Int_t)dummy;
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgRows[i][1]=(Int_t)dummy;
}
}
else if(strcmp(d1,"fSlice2Sector[0][0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fSlice2Sector[0][0]=(Int_t)dummy;
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fSlice2Sector[0][1]=(Int_t)dummy;
- for(Int_t i=1;i<fNSlice;i++){
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fSlice2Sector[i][0]=(Int_t)dummy;
- fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fSlice2Sector[i][1]=(Int_t)dummy;
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSlice2Sector[0][0]=(Int_t)dummy;
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[0][1]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNSlice;i++){
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[i][0]=(Int_t)dummy;
+ fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSlice2Sector[i][1]=(Int_t)dummy;
}
}
else if(strcmp(d1,"fSector2Slice[0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fSector2Slice[0]=(Int_t)dummy;
- for(Int_t i=1;i<fNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fSector2Slice[i]=(Int_t)dummy;}
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSector2Slice[0]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSector2Slice[i]=(Int_t)dummy;}
}
else if(strcmp(d1,"fSectorLow[0]")==0){
- fscanf(fptr,"%s %d %s",d2,&dummy,d3);fSectorLow[0]=(Int_t)dummy;
- for(Int_t i=1;i<fNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fSectorLow[i]=(Int_t)dummy;}
+ fscanf(fptr,"%s %d %s",d2,&dummy,d3);fgSectorLow[0]=(Int_t)dummy;
+ for(Int_t i=1;i<fgNSector;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fgSectorLow[i]=(Int_t)dummy;}
}
else if(strcmp(d1,"fCos[0]")==0){
- fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fCos[0]=(Double_t)ddummy;
- for(Int_t i=1;i<fNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fCos[i]=(Double_t)ddummy;}
+ fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgCos[0]=(Double_t)ddummy;
+ for(Int_t i=1;i<fgNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgCos[i]=(Double_t)ddummy;}
}
else if(strcmp(d1,"fSin[0]")==0){
- fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fSin[0]=(Double_t)ddummy;
- for(Int_t i=1;i<fNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fSin[i]=(Double_t)ddummy;}
+ fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fgSin[0]=(Double_t)ddummy;
+ for(Int_t i=1;i<fgNSlice;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fgSin[i]=(Double_t)ddummy;}
}
}
fclose(fptr);
//The first multiplier gives the scale factor used to modify the field map
//defined by the second multiplier.
- fBField=fBFieldFactor*fSolenoidBField*0.1;
+ fgBField=fgBFieldFactor*fgSolenoidBField*0.1;
//Test if new config file has been used.
- if(fVersion==fV_deprecated){
+ if(fgVersion==kVdeprecated){
LOG(AliL3Log::kError,"AliL3Transform::ReadInitFile","Version")
<<"Version is deprecated, you have to create a new config file."<<ENDLOG;
return kFALSE;
Bool_t AliL3Transform::MakeInitFile(Char_t *rootfilename,Char_t *filename)
{
//Get the parameters from rootfile, and store it on the file "l3transform.config"
- //which is being read by Init. fVersion will be fV_aliroot!
+ //which is being read by Init. fVersion will be kV_aliroot!
#ifndef use_aliroot
LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","Version")
param->SetOuter2PRF(prfouter2);
param->SetTimeRF(rf);
- fNTimeBins = param->GetMaxTBin()+1;
- fNRowLow = param->GetNRowLow();
- fNRowUp = param->GetNRowUp();
- fNRowUp1 = param->GetNRowUp1();
- fNRowUp2 = param->GetNRowUp2();
- fNRow= fNRowLow + fNRowUp;
- if(fNRow!=159){
+ fgNTimeBins = param->GetMaxTBin()+1;
+ fgNRowLow = param->GetNRowLow();
+ fgNRowUp = param->GetNRowUp();
+ fgNRowUp1 = param->GetNRowUp1();
+ fgNRowUp2 = param->GetNRowUp2();
+ fgNRow= fgNRowLow + fgNRowUp;
+ if(fgNRow!=159){
LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","fNRow")
<<"Number of rows have changed in ALIROOT"<<ENDLOG;
return kFALSE;
}
- fNSectorLow = param->GetNInnerSector();
- fNSectorUp = param->GetNOuterSector();
- fNSector = fNSectorLow + fNSectorUp;
+ fgNSectorLow = param->GetNInnerSector();
+ fgNSectorUp = param->GetNOuterSector();
+ fgNSector = fgNSectorLow + fgNSectorUp;
//test whether they were changes to the rotation shift
- fNRotShift=0;
+ fgNRotShift=0;
Float_t irotshift = param->GetInnerAngleShift(); //shift angle
Float_t orotshift = param->GetOuterAngleShift(); //shift angle
const Float_t kDegtoRad = 0.01745329251994;
<<"Rotation shift angle has changed in ALIROOT"<<ENDLOG;
return kFALSE;
} else {
- fNRotShift=0.5; //our version of the shift angle
+ fgNRotShift=0.5; //our version of the shift angle
}
- fVersion=fV_aliroot;
+ fgVersion=kValiroot;
SetBFieldFactor((Double_t)gAlice->Field()->Factor());
SetSolenoidBField((Double_t)gAlice->Field()->SolenoidField());
- fPadPitchWidthLow=param->GetInnerPadPitchWidth();
- fPadPitchWidthUp=param->GetOuterPadPitchWidth();
- fZWidth=param->GetZWidth();
- fZSigma=param->GetZSigma();
- fZLength=param->GetZLength();
- fZOffset=param->GetZOffset();
- fDiffT=param->GetDiffT();
- fDiffL=param->GetDiffL();
- fOmegaTau=param->GetOmegaTau();
- fInnerPadLength=param->GetInnerPadLength();
- fOuter1PadLength=param->GetOuter1PadLength();
- fOuter2PadLength=param->GetOuter2PadLength();
- fInnerPRFSigma=param->GetInnerPRF()->GetSigmaX();
- fOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX();
- fOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX();
- fTimeSigma=param->GetTimeRF()->GetSigma();
- fADCSat=param->GetADCSat();
- fZeroSup=param->GetZeroSup();
- fNSlice=fNSectorLow;
+ fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
+ fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
+ fgZWidth=param->GetZWidth();
+ fgZSigma=param->GetZSigma();
+ fgZLength=param->GetZLength();
+ fgZOffset=param->GetZOffset();
+ fgDiffT=param->GetDiffT();
+ fgDiffL=param->GetDiffL();
+ fgOmegaTau=param->GetOmegaTau();
+ fgInnerPadLength=param->GetInnerPadLength();
+ fgOuter1PadLength=param->GetOuter1PadLength();
+ fgOuter2PadLength=param->GetOuter2PadLength();
+ fgInnerPRFSigma=param->GetInnerPRF()->GetSigmaX();
+ fgOuter1PRFSigma=param->GetOuter1PRF()->GetSigmaX();
+ fgOuter2PRFSigma=param->GetOuter2PRF()->GetSigmaX();
+ fgTimeSigma=param->GetTimeRF()->GetSigma();
+ fgADCSat=param->GetADCSat();
+ fgZeroSup=param->GetZeroSup();
+ fgNSlice=fgNSectorLow;
//now do the arrays
- for(Int_t i=0;i<fNRow;i++){
+ for(Int_t i=0;i<fgNRow;i++){
Int_t sec,row;
- if( i < fNRowLow){sec =0;row =i;}
- else{sec = fNSectorLow;row =i-fNRowLow;}
- fX[i]=param->GetPadRowRadii(sec,row);
+ if( i < fgNRowLow){sec =0;row =i;}
+ else{sec = fgNSectorLow;row =i-fgNRowLow;}
+ fgX[i]=param->GetPadRowRadii(sec,row);
}
- for(Int_t i=0;i<fNRow;i++){
+ for(Int_t i=0;i<fgNRow;i++){
Int_t sec,row;
- if( i < fNRowLow){sec =0;row =i;}
- else{sec = fNSectorLow;row =i-fNRowLow;}
- fNPads[i]=param->GetNPads(sec,row);
+ if( i < fgNRowLow){sec =0;row =i;}
+ else{sec = fgNSectorLow;row =i-fgNRowLow;}
+ fgNPads[i]=param->GetNPads(sec,row);
}
- for(Int_t i=0;i<fNSector;i++){
- if(i<fNSectorLow) fSectorLow[i]=1;
- else fSectorLow[i]=0;
+ for(Int_t i=0;i<fgNSector;i++){
+ if(i<fgNSectorLow) fgSectorLow[i]=1;
+ else fgSectorLow[i]=0;
}
delete gAlice;
}
fprintf(f,"void AliL3Transform::Init(){\n");
- fprintf(f," fVersion = %d;\n", fVersion);
- fprintf(f," fBFieldFactor = %.3f;\n",fBFieldFactor);
- fprintf(f," fSolenoidBField = %.3f;\n",fSolenoidBField);
- fprintf(f," fNTimeBins = %d;\n",fNTimeBins);
- fprintf(f," fNRowLow = %d;\n",fNRowLow);
- fprintf(f," fNRowUp = %d;\n",fNRowUp);
- fprintf(f," fNRowUp1 = %d;\n",fNRowUp1);
- fprintf(f," fNRowUp2 = %d;\n",fNRowUp2);
- fprintf(f," fNSectorLow = %d;\n",fNSectorLow);
- fprintf(f," fNSectorUp = %d;\n",fNSectorUp);
- fprintf(f," fNSector = %d;\n",fNSector);
- fprintf(f," fPadPitchWidthLow = %.3f;\n",fPadPitchWidthLow);
- fprintf(f," fPadPitchWidthUp = %.3f;\n",fPadPitchWidthUp);
- fprintf(f," fZWidth = %.4f;\n",fZWidth);
- fprintf(f," fZSigma = %.4f;\n",fZSigma);
- fprintf(f," fZLength = %.4f;\n",fZLength);
- fprintf(f," fZOffset = %.4f;\n",fZOffset);
- fprintf(f," fDiffT = %.4f;\n",fDiffT);
- fprintf(f," fDiffL = %.4f;\n",fDiffL);
- fprintf(f," fOmegaTau = %.4f;\n",fOmegaTau);
- fprintf(f," fInnerPadLength = %.3f;\n",fInnerPadLength);
- fprintf(f," fOuter1PadLength = %.3f;\n",fOuter1PadLength);
- fprintf(f," fOuter2PadLength = %.3f;\n",fOuter2PadLength);
- fprintf(f," fInnerPRFSigma = %.6f;\n",fInnerPRFSigma);
- fprintf(f," fOuter1PRFSigma = %.6f;\n",fOuter1PRFSigma);
- fprintf(f," fOuter2PRFSigma = %.6f;\n",fOuter2PRFSigma);
- fprintf(f," fTimeSigma = %.6f;\n",fTimeSigma);
- fprintf(f," fADCSat = %d;\n",fADCSat);
- fprintf(f," fZeroSup = %d;\n",fZeroSup);
- fprintf(f," fNSlice = %d;\n",fNSlice);
- fprintf(f," fNRow = %d;\n",fNRow);
- fprintf(f," fNRotShift = %.2f;\n",fNRotShift);
+ fprintf(f," fVersion = %d;\n", fgVersion);
+ fprintf(f," fBFieldFactor = %.3f;\n",fgBFieldFactor);
+ fprintf(f," fSolenoidBField = %.3f;\n",fgSolenoidBField);
+ fprintf(f," fNTimeBins = %d;\n",fgNTimeBins);
+ fprintf(f," fNRowLow = %d;\n",fgNRowLow);
+ fprintf(f," fNRowUp = %d;\n",fgNRowUp);
+ fprintf(f," fNRowUp1 = %d;\n",fgNRowUp1);
+ fprintf(f," fNRowUp2 = %d;\n",fgNRowUp2);
+ fprintf(f," fNSectorLow = %d;\n",fgNSectorLow);
+ fprintf(f," fNSectorUp = %d;\n",fgNSectorUp);
+ fprintf(f," fNSector = %d;\n",fgNSector);
+ fprintf(f," fPadPitchWidthLow = %.3f;\n",fgPadPitchWidthLow);
+ fprintf(f," fPadPitchWidthUp = %.3f;\n",fgPadPitchWidthUp);
+ fprintf(f," fZWidth = %.4f;\n",fgZWidth);
+ fprintf(f," fZSigma = %.4f;\n",fgZSigma);
+ fprintf(f," fZLength = %.4f;\n",fgZLength);
+ fprintf(f," fZOffset = %.4f;\n",fgZOffset);
+ fprintf(f," fDiffT = %.4f;\n",fgDiffT);
+ fprintf(f," fDiffL = %.4f;\n",fgDiffL);
+ fprintf(f," fOmegaTau = %.4f;\n",fgOmegaTau);
+ fprintf(f," fInnerPadLength = %.3f;\n",fgInnerPadLength);
+ fprintf(f," fOuter1PadLength = %.3f;\n",fgOuter1PadLength);
+ fprintf(f," fOuter2PadLength = %.3f;\n",fgOuter2PadLength);
+ fprintf(f," fInnerPRFSigma = %.6f;\n",fgInnerPRFSigma);
+ fprintf(f," fOuter1PRFSigma = %.6f;\n",fgOuter1PRFSigma);
+ fprintf(f," fOuter2PRFSigma = %.6f;\n",fgOuter2PRFSigma);
+ fprintf(f," fTimeSigma = %.6f;\n",fgTimeSigma);
+ fprintf(f," fADCSat = %d;\n",fgADCSat);
+ fprintf(f," fZeroSup = %d;\n",fgZeroSup);
+ fprintf(f," fNSlice = %d;\n",fgNSlice);
+ fprintf(f," fNRow = %d;\n",fgNRow);
+ fprintf(f," fNRotShift = %.2f;\n",fgNRotShift);
//now do the arrays
- for(Int_t i=0;i<fNRow;i++){
- fprintf(f," fX[%d] = %3.2f;\n",i,fX[i]);
+ for(Int_t i=0;i<fgNRow;i++){
+ fprintf(f," fX[%d] = %3.2f;\n",i,fgX[i]);
}
- for(Int_t i=0;i<fNRow;i++){
- fprintf(f," fNPads[%d] = %d;\n",i,fNPads[i]);
+ for(Int_t i=0;i<fgNRow;i++){
+ fprintf(f," fNPads[%d] = %d;\n",i,fgNPads[i]);
}
//Slice/Sector dont belong to aliroot, but we want to be flexible
- for(Int_t i=0;i<fNSlice;i++){
- fprintf(f," fSlice2Sector[%d][0] = %d;\n",i,fSlice2Sector[i][0]);
- fprintf(f," fSlice2Sector[%d][1] = %d;\n",i,fSlice2Sector[i][1]);
+ for(Int_t i=0;i<fgNSlice;i++){
+ fprintf(f," fSlice2Sector[%d][0] = %d;\n",i,fgSlice2Sector[i][0]);
+ fprintf(f," fSlice2Sector[%d][1] = %d;\n",i,fgSlice2Sector[i][1]);
}
- for(Int_t i=0;i<fNSector;i++){
- fprintf(f," fSector2Slice[%d] = %d;\n",i,fSector2Slice[i]);
+ for(Int_t i=0;i<fgNSector;i++){
+ fprintf(f," fSector2Slice[%d] = %d;\n",i,fgSector2Slice[i]);
}
- for(Int_t i=0;i<fNSector;i++){
- fprintf(f," fSectorLow[%d] = %d;\n",i,fSectorLow[i]);
+ for(Int_t i=0;i<fgNSector;i++){
+ fprintf(f," fSectorLow[%d] = %d;\n",i,fgSectorLow[i]);
}
//Patches also dont really belong to the aliroot settings (but nevermind)
- for(Int_t i=0;i<fNPatches;i++){
- fprintf(f," fNRows[%d] = %d;\n",i,fNRows[i]);
+ for(Int_t i=0;i<fgNPatches;i++){
+ fprintf(f," fNRows[%d] = %d;\n",i,fgNRows[i]);
}
- for(Int_t i=0;i<fNPatches;i++){
- fprintf(f," fRows[%d][0] = %d;\n",i,fRows[i][0]);
- fprintf(f," fRows[%d][1] = %d;\n",i,fRows[i][1]);
+ for(Int_t i=0;i<fgNPatches;i++){
+ fprintf(f," fRows[%d][0] = %d;\n",i,fgRows[i][0]);
+ fprintf(f," fRows[%d][1] = %d;\n",i,fgRows[i][1]);
}
//Rotation shift is an addon, too
- for(Int_t i=0;i<fNSlice;i++){
- Float_t cs = cos( (2*fPi/18) * (i+fNRotShift) );
+ for(Int_t i=0;i<fgNSlice;i++){
+ Float_t cs = cos( (2*fgkPi/18) * (i+fgNRotShift) );
fprintf(f," fCos[%d] = %.10f;\n",i,cs);
}
- for(Int_t i=0;i<fNSlice;i++){
- Float_t sn = sin( (2*fPi/18) * (i+fNRotShift) );
+ for(Int_t i=0;i<fgNSlice;i++){
+ Float_t sn = sin( (2*fgkPi/18) * (i+fgNRotShift) );
fprintf(f," fSin[%d] = %.10f;\n",i,sn);
}
Int_t AliL3Transform::GetNPads(Int_t row)
{
- if(row < 0 || row >= fNRow)
+ //get number of pads per row
+ if(row < 0 || row >= fgNRow)
{
LOG(AliL3Log::kError,"AliL3Transform::GetNPads","Row")
<<AliL3Log::kDec<<"Wrong row "<<row<<ENDLOG;
return 0;
}
- return fNPads[row];
+ return fgNPads[row];
}
Int_t AliL3Transform::GetFirstRow(Int_t patch)
{
+ //get first row per patch
+
if(patch==-1)
return 0;
else if(patch < -1 || patch >= 6)
return 0;
}
else
- return fRows[patch][0];
+ return fgRows[patch][0];
}
Int_t AliL3Transform::GetLastRow(Int_t patch)
{
+ //get last row per patch
if(patch==-1)
- return fRows[5][1];
+ return fgRows[5][1];
else if(patch < -1 || patch >= 6)
{
LOG(AliL3Log::kError,"AliL3Transform::GetLastRow","Patch")
return 0;
}
else
- return fRows[patch][1];
+ return fgRows[patch][1];
}
Int_t AliL3Transform::GetNRows(Int_t patch)
{
+ //get number of rows per patch
if(patch==-1)
- return fNRow;
+ return fgNRow;
else if(patch < -1 || patch >= 6)
{
LOG(AliL3Log::kError,"AliL3Transform::GetNRows","Patch")
return 0;
}
else
- return fNRows[patch];
+ return fgNRows[patch];
}
Int_t AliL3Transform::GetPadRow(Float_t xvalue)
{
//Find the padrow number corresponding to cartesian _local_ x value
-
if(xvalue < 0 || xvalue > 250)
{
LOG(AliL3Log::kError,"AliL3Transform::GetPadRow","X-value")
}
Int_t x = (Int_t)rint(xvalue*10);
- if(x < (Int_t)rint(fX[1]*10))
+ if(x < (Int_t)rint(fgX[1]*10))
return 0;
- else if(x > (Int_t)rint(fX[fNRow-2]*10))
- return fNRow-1;
+ else if(x > (Int_t)rint(fgX[fgNRow-2]*10))
+ return fgNRow-1;
else
{
Int_t padrow=1; //Of course, a more clever algorithm could help here
- while(padrow < fNRow-2)
+ while(padrow < fgNRow-2)
{
- if(x > (Int_t)rint(fX[padrow-1]*10) && x < (Int_t)rint(fX[padrow+1]*10))
+ if(x > (Int_t)rint(fgX[padrow-1]*10) && x < (Int_t)rint(fgX[padrow+1]*10))
break;
padrow++;
}
Int_t AliL3Transform::GetPatch(Int_t padrow)
{
- if(padrow < 0 || padrow >= fNRow)
+ //get patch for padrow
+ if(padrow < 0 || padrow >= fgNRow)
{
LOG(AliL3Log::kError,"AliL3Transform::GetPatch","Padrow")
<<AliL3Log::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
return -2;
}
Int_t patch=0;
- while(patch < fNPatches)
+ while(patch < fgNPatches)
{
- if(padrow >= fRows[patch][0] && padrow <= fRows[patch][1])
+ if(padrow >= fgRows[patch][0] && padrow <= fgRows[patch][1])
break;
patch++;
}
Double_t AliL3Transform::GetPadLength(Int_t padrow)
{
- if(padrow >= fNRow){
+ //get pad length for padrow
+ if(padrow >= fgNRow){
LOG(AliL3Log::kError,"AliL3Transform::GetPadLength","Padrow")
<<AliL3Log::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
return 0;
}
- if(padrow < fNRowLow)
- return fInnerPadLength;
- if(padrow >= fNRowLow && padrow < fNRowLow + fNRowUp1 - 1)
- return fOuter1PadLength;
- if(padrow >= fNRowLow + fNRowUp1 - 1)
- return fOuter2PadLength;
+ if(padrow < fgNRowLow)
+ return fgInnerPadLength;
+ if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1)
+ return fgOuter1PadLength;
+ if(padrow >= fgNRowLow + fgNRowUp1 - 1)
+ return fgOuter2PadLength;
//should never happen
LOG(AliL3Log::kError,"AliL3Transform::GetPadLength","Padrow")
Double_t AliL3Transform::GetPadPitchWidth(Int_t patch)
{
- if(patch < 0 || patch > fNPatches)
+ //get pad patch width for patch
+ if(patch < 0 || patch > fgNPatches)
{
LOG(AliL3Log::kError,"AliL3Transform::GetPadPitchWidth","patct")
<<AliL3Log::kDec<<"Wrong patch "<<patch<<ENDLOG;
return -1;
}
- return patch < 2 ? fPadPitchWidthLow : fPadPitchWidthUp;
+ return patch < 2 ? fgPadPitchWidthLow : fgPadPitchWidthUp;
}
Double_t AliL3Transform::GetParSigmaY2(Int_t padrow,Float_t z,Float_t angle)
Double_t drift;
if(z > 0)
- drift = fZLength - z;
+ drift = fgZLength - z;
else
- drift = fZLength + z;
+ drift = fgZLength + z;
Double_t t1 = GetPRFSigma(padrow)*GetPRFSigma(padrow);
- Double_t t2 = fDiffT*fDiffT*drift;
+ Double_t t2 = fgDiffT*fgDiffT*drift;
Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tan(angle)*tan(angle)/12;
- Double_t t4 = fAnodeWireSpacing*fAnodeWireSpacing*(tan(angle) - fOmegaTau)*(tan(angle) - fOmegaTau)/12;
+ Double_t t4 = fgkAnodeWireSpacing*fgkAnodeWireSpacing*(tan(angle) - fgOmegaTau)*(tan(angle) - fgOmegaTau)/12;
return (t1 + t2 + t3 + t4);
}
else
drift = AliL3Transform::GetZLength() + z;
- Double_t t1 = fZSigma*fZSigma;
- Double_t t2 = fDiffL*fDiffL*drift;
+ Double_t t1 = fgZSigma*fgZSigma;
+ Double_t t2 = fgDiffL*fgDiffL*drift;
Double_t t3 = GetPadLength(padrow)*GetPadLength(padrow)*tgl*tgl/12;
return (t1 + t2 + t3);
Double_t AliL3Transform::GetPRFSigma(Int_t padrow)
{
- if(padrow >= fNRow){
+ //get sigma of pad response function for padrow
+
+ if(padrow >= fgNRow){
LOG(AliL3Log::kError,"AliL3Transform::GetPRFSigma","Padrow")
<<AliL3Log::kDec<<"Wrong padrow "<<padrow<<ENDLOG;
return 0;
}
- if(padrow < fNRowLow)
- return fInnerPRFSigma;
- if(padrow >= fNRowLow && padrow < fNRowLow + fNRowUp1 - 1)
- return fOuter1PRFSigma;
- if(padrow >= fNRowLow + fNRowUp1 - 1)
- return fOuter2PRFSigma;
+ if(padrow < fgNRowLow)
+ return fgInnerPRFSigma;
+ if(padrow >= fgNRowLow && padrow < fgNRowLow + fgNRowUp1 - 1)
+ return fgOuter1PRFSigma;
+ if(padrow >= fgNRowLow + fgNRowUp1 - 1)
+ return fgOuter2PRFSigma;
//should never happen
LOG(AliL3Log::kError,"AliL3Transform::GetPRFSigma","Padrow")
Double_t AliL3Transform::GetEta(Float_t *xyz)
{
+ //get eta
Double_t r3 = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
Double_t eta = 0.5 * log((r3+xyz[2])/(r3-xyz[2]));
return eta;
void AliL3Transform::XYZtoRPhiEta(Float_t *rpe, Float_t *xyz)
{
+ //transform xyz into rpe
rpe[0] = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
rpe[1] = atan2(xyz[1],xyz[0]);
rpe[2] = 0.5 * log((rpe[0]+xyz[2])/(rpe[0]-xyz[2]));
Double_t AliL3Transform::GetEta(Int_t slice,Int_t padrow,Int_t pad,Int_t time)
{
+ //get eta
Float_t xyz[3];
Int_t sector,row;
Slice2Sector(slice,padrow,sector,row);
Double_t AliL3Transform::GetPhi(Float_t *xyz)
{
+ //get phi
Double_t phi = atan2(xyz[1],xyz[0]);
return phi;
}
Bool_t AliL3Transform::Slice2Sector(Int_t slice, Int_t slicerow, Int_t & sector, Int_t &row)
{
- if(slicerow<0&&slicerow>=fNRow){
+ //slice to sector number
+ if(slicerow<0&&slicerow>=fgNRow){
LOG(AliL3Log::kError,"AliL3Transform::Slice2Sector","Slicerow")
<<AliL3Log::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG;
return kFALSE;
}
- if(slice<0||slice>=fNSlice){
+ if(slice<0||slice>=fgNSlice){
LOG(AliL3Log::kError,"AliL3Transform::Slice2Sector","Slice")
<<AliL3Log::kDec<<"Wrong slice "<<slice<<ENDLOG;
return kFALSE;
}
- if(slicerow<fNRowLow){
- sector = fSlice2Sector[slice][0];
+ if(slicerow<fgNRowLow){
+ sector = fgSlice2Sector[slice][0];
row = slicerow;
}
else {
- sector = fSlice2Sector[slice][1];
- row = slicerow-fNRowLow;
+ sector = fgSlice2Sector[slice][1];
+ row = slicerow-fgNRowLow;
}
return kTRUE;
Bool_t AliL3Transform::Sector2Slice(Int_t & slice, Int_t sector)
{
- if(sector<0||sector>=fNSector){
+ //sector to slice
+ if(sector<0||sector>=fgNSector){
LOG(AliL3Log::kError,"AliL3Transform::Sector2Slice","Sector")
<<AliL3Log::kDec<<"Wrong sector "<<sector<<ENDLOG;
return kFALSE;
}
- slice=fSector2Slice[sector];
+ slice=fgSector2Slice[sector];
return kTRUE;
}
Bool_t AliL3Transform::Sector2Slice(Int_t & slice, Int_t & slicerow, Int_t sector, Int_t row)
{
- if(sector<0 || sector>=fNSector){
+ //sector to slice
+ if(sector<0 || sector>=fgNSector){
LOG(AliL3Log::kError,"AliL3Transform::Sector2Slice","Sector")
<<AliL3Log::kDec<<"Wrong sector "<<sector<<ENDLOG;
return kFALSE;
return kFALSE;
}
- if(fSectorLow[sector]){
- if(row>=fNRowLow){
+ if(fgSectorLow[sector]){
+ if(row>=fgNRowLow){
LOG(AliL3Log::kError,"AliL3Transform::Sector2Slice","Row")
<<AliL3Log::kDec<<"Wrong row "<<row<<ENDLOG;
return kFALSE;
}
- slice = fSector2Slice[sector];
+ slice = fgSector2Slice[sector];
slicerow = row;
}
else{
- if(row>=fNRowUp){
+ if(row>=fgNRowUp){
LOG(AliL3Log::kError,"AliL3Transform::Sector2Slice","Row")
<<AliL3Log::kDec<<"Wrong row "<<row<<ENDLOG;
return kFALSE;
}
- slice = fSector2Slice[sector];
- slicerow = row + fNRowLow;
+ slice = fgSector2Slice[sector];
+ slicerow = row + fgNRowLow;
}
return kTRUE;
Double_t AliL3Transform::GetMaxY(Int_t slicerow)
{
- if(slicerow < fNRowLow)
- return fPadPitchWidthLow*fNPads[slicerow]/2;
+ //get maximum y value (for slice 0)
+ if(slicerow < fgNRowLow)
+ return fgPadPitchWidthLow*fgNPads[slicerow]/2;
else
- return fPadPitchWidthUp*fNPads[slicerow]/2;
+ return fgPadPitchWidthUp*fgNPads[slicerow]/2;
}
-Double_t AliL3Transform::Row2X(Int_t slicerow){
- if(slicerow<0||slicerow>=fNRow){
+Double_t AliL3Transform::Row2X(Int_t slicerow)
+{
+ //slicerow to X value (slice 0)
+ if(slicerow<0||slicerow>=fgNRow){
LOG(AliL3Log::kError,"AliL3Transform::Row2X","Slicerow")
<<AliL3Log::kDec<<"Wrong slicerow "<<slicerow<<ENDLOG;
return 0;
}
- return fX[slicerow];
+ return fgX[slicerow];
}
Double_t AliL3Transform::GetZFast(Int_t slice, Int_t time, Float_t vertex)
{
- Double_t z=fZWidth*time-fZOffset;
+ //get z value
+ Double_t z=fgZWidth*time-fgZOffset;
if(slice < 18)
- z=fZLength-z-vertex;
+ z=fgZLength-z-vertex;
else
- z=z-fZLength-vertex;
+ z=z-fgZLength-vertex;
return z;
}
Float_t x0 = xyz[0];
Float_t y0 = xyz[1];
- xyz[0]=x0*fCos[slice]-y0*fSin[slice];
- xyz[1]=x0*fSin[slice]+y0*fCos[slice];
+ xyz[0]=x0*fgCos[slice]-y0*fgSin[slice];
+ xyz[1]=x0*fgSin[slice]+y0*fgCos[slice];
xyz[2]=xyz[2];//global z=local z
}
-void AliL3Transform::Local2GlobalAngle(Float_t *angle,Int_t slice){
- angle[0] = fmod(angle[0]+(slice+fNRotShift)*(2*fPi/18),2*fPi);
+void AliL3Transform::Local2GlobalAngle(Float_t *angle,Int_t slice)
+{
+ //get angle global
+ angle[0] = fmod(angle[0]+(slice+fgNRotShift)*(2*fgkPi/18),2*fgkPi);
}
-void AliL3Transform::Global2LocalAngle(Float_t *angle,Int_t slice){
- angle[0] = angle[0]-(slice+fNRotShift)*(2*fPi/18);
- if(angle[0]<0) angle[0]+=2*fPi;
+void AliL3Transform::Global2LocalAngle(Float_t *angle,Int_t slice)
+{
+ //get angle local
+ angle[0] = angle[0]-(slice+fgNRotShift)*(2*fgkPi/18);
+ if(angle[0]<0) angle[0]+=2*fgkPi;
}
void AliL3Transform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time)
xyz[0]=Row2X(slicerow);
//Y-Value
- Int_t npads= fNPads[slicerow];
+ Int_t npads= fgNPads[slicerow];
- if(fSectorLow[sector])
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
+ if(fgSectorLow[sector])
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
else
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
//Z-Value (remember PULSA Delay)
if(slice < 18)
- xyz[2]=fZLength-fZWidth*time+fZOffset;
+ xyz[2]=fgZLength-fgZWidth*time+fgZOffset;
else
- xyz[2]=fZWidth*time-fZOffset-fZLength;
+ xyz[2]=fgZWidth*time-fgZOffset-fgZLength;
}
void AliL3Transform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Int_t pad,Int_t time)
xyz[0]=Row2X(slicerow);
//Y-Value
- Int_t npads= fNPads[slicerow];
+ Int_t npads= fgNPads[slicerow];
- if(fSectorLow[sector])
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
+ if(fgSectorLow[sector])
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
else
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
//Z-Value (remember PULSA Delay)
if(slice < 18)
- xyz[2]=fZLength-fZWidth*time+fZOffset;
+ xyz[2]=fgZLength-fgZWidth*time+fgZOffset;
else
- xyz[2]=fZWidth*time-fZOffset-fZLength;
+ xyz[2]=fgZWidth*time-fgZOffset-fgZLength;
}
void AliL3Transform::RawHLT2Local(Float_t *xyz,Int_t slice,
xyz[0]=Row2X(slicerow);
//Y-Value
- Int_t npads= fNPads[slicerow];
- if(slicerow<fNRowLow)
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
+ Int_t npads= fgNPads[slicerow];
+ if(slicerow<fgNRowLow)
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
else
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
//Z-Value
if(slice < 18)
- xyz[2]=fZLength-fZWidth*time+fZOffset;
+ xyz[2]=fgZLength-fgZWidth*time+fgZOffset;
else
- xyz[2]=fZWidth*time-fZOffset-fZLength;
+ xyz[2]=fgZWidth*time-fgZOffset-fgZLength;
}
void AliL3Transform::RawHLT2Local(Float_t *xyz,Int_t slice,
xyz[0]=Row2X(slicerow);
//Y-Value
- Int_t npads= fNPads[slicerow];
- if(slicerow<fNRowLow)
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
+ Int_t npads= fgNPads[slicerow];
+ if(slicerow<fgNRowLow)
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthLow;
else
- xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
+ xyz[1]=(pad-0.5*(npads-1))*fgPadPitchWidthUp;
//Z-Value
if(slice < 18)
- xyz[2]=fZLength-fZWidth*time+fZOffset;
+ xyz[2]=fgZLength-fgZWidth*time+fgZOffset;
else
- xyz[2]=fZWidth*time-fZOffset-fZLength;
+ xyz[2]=fgZWidth*time-fgZOffset-fgZLength;
}
void AliL3Transform::Local2Global(Float_t *xyz,Int_t sector,Int_t row)
Sector2Slice(slice, slicerow, sector, row);
Float_t r=Row2X(slicerow); //have to get x value first
- xyz[0]=r*fCos[slice]-xyz[1]*fSin[slice];
- xyz[1]=r*fSin[slice]+xyz[1]*fCos[slice];
+ xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice];
+ xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice];
xyz[2]=xyz[2];//global z=local z
}
//Transformation from HLT to global coordinate system
Float_t r=Row2X(slicerow); //have to get x value first
- xyz[0]=r*fCos[slice]-xyz[1]*fSin[slice];
- xyz[1]=r*fSin[slice]+xyz[1]*fCos[slice];
+ xyz[0]=r*fgCos[slice]-xyz[1]*fgSin[slice];
+ xyz[1]=r*fgSin[slice]+xyz[1]*fgCos[slice];
xyz[2]=xyz[2];//global z=local z
}
void AliL3Transform::Global2Local(Float_t *xyz,Int_t sector)
{ //check code
Int_t slice;
- //if(!isSlice)
- Sector2Slice(slice, sector);
- //else
- //slice = sector;
+ Sector2Slice(slice, sector);
- Float_t x1 = xyz[0]*fCos[slice] + xyz[1]*fSin[slice];
- Float_t y1 = -xyz[0]*fSin[slice] + xyz[1]*fCos[slice];
+ Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice];
+ Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice];
xyz[0] = x1;
xyz[1] = y1;
}
void AliL3Transform::Global2LocHLT(Float_t *xyz,Int_t slice)
{
- Float_t x1 = xyz[0]*fCos[slice] + xyz[1]*fSin[slice];
- Float_t y1 = -xyz[0]*fSin[slice] + xyz[1]*fCos[slice];
+ Float_t x1 = xyz[0]*fgCos[slice] + xyz[1]*fgSin[slice];
+ Float_t y1 = -xyz[0]*fgSin[slice] + xyz[1]*fgCos[slice];
xyz[0] = x1;
xyz[1] = y1;
}
xyz[0]=slicerow;
- if(fSectorLow[sector])
- xyz[1]=xyz[1]/fPadPitchWidthLow+0.5*(fNPads[slicerow]-1);
+ if(fgSectorLow[sector])
+ xyz[1]=xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]-1);
else
- xyz[1]=xyz[1]/fPadPitchWidthUp+0.5*(fNPads[slicerow]-1);
+ xyz[1]=xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]-1);
if(slice < 18)
- xyz[2]=(fZLength-xyz[2]+fZOffset)/fZWidth;
+ xyz[2]=(fgZLength-xyz[2]+fgZOffset)/fgZWidth;
else
- xyz[2]=(fZLength+xyz[2]+fZOffset)/fZWidth;
+ xyz[2]=(fgZLength+xyz[2]+fgZOffset)/fgZWidth;
}
void AliL3Transform::LocHLT2Raw(Float_t *xyz,Int_t slice,Int_t slicerow)
xyz[0]=slicerow;
- if(slicerow<fNRowLow)
- xyz[1]=xyz[1]/fPadPitchWidthLow+0.5*(fNPads[slicerow]-1);
+ if(slicerow<fgNRowLow)
+ xyz[1]=xyz[1]/fgPadPitchWidthLow+0.5*(fgNPads[slicerow]-1);
else
- xyz[1]=xyz[1]/fPadPitchWidthUp+0.5*(fNPads[slicerow]-1);
+ xyz[1]=xyz[1]/fgPadPitchWidthUp+0.5*(fgNPads[slicerow]-1);
if(slice < 18)
- xyz[2]=(fZLength-xyz[2]+fZOffset)/fZWidth;
+ xyz[2]=(fgZLength-xyz[2]+fgZOffset)/fgZWidth;
else
- xyz[2]=(fZLength+xyz[2]+fZOffset)/fZWidth;
+ xyz[2]=(fgZLength+xyz[2]+fgZOffset)/fgZWidth;
}
void AliL3Transform::Global2Raw(Float_t *xyz,Int_t sector,Int_t row)
void AliL3Transform::PrintCompileOptions()
{
+ //print compile options
#if defined(__GNUC__)
cout << "Compiler (g++) version used: " << __GNUC__ << endl;
#endif
class AliL3Transform {
public:
- enum VersionType { fV_default=0, fV_deprecated=1, fV_aliroot=10, fV_cosmics=100};
+ enum VersionType { kVdefault=0, kVdeprecated=1, kValiroot=10, kVcosmics=100};
private:
- static const Double_t fBFACT;
- static const Double_t fPi;
- static const Double_t fPi2;
- static const Double_t f2Pi;
- static const Double_t fAnodeWireSpacing;
- static const Double_t fToDeg;
-
- static Int_t fNPatches; //6 (dont change this)
- static Int_t fRows[6][2];
- static Int_t fNRows[6];
-
- static Double_t fBField;
- static Double_t fBFieldFactor;
- static Double_t fSolenoidBField;
- static Int_t fNTimeBins;
- static Int_t fNRowLow;
- static Int_t fNRowUp;
- static Int_t fNRowUp1;
- static Int_t fNRowUp2;
- static Int_t fNSectorLow;
- static Int_t fNSectorUp;
- static Int_t fSlice2Sector[36][2];
- static Int_t fSector2Slice[72];
- static Int_t fSectorLow[72];
- static Double_t fPadPitchWidthLow;
- static Double_t fPadPitchWidthUp;
- static Double_t fZWidth;
- static Double_t fZSigma;
- static Double_t fZLength;
- static Double_t fZOffset;
- static Int_t fNSector; //72 (dont change this)
- static Int_t fNSlice; //36 (dont change this)
- static Int_t fNRow; //159 (dont change this)
- static Double_t fNRotShift; //Rotation shift (eg. 0.5 for 10 degrees)
- static Int_t fNPads[159]; //fill this following Init and fVersion
- static Double_t fX[159]; //X position in local coordinates
- static Int_t fVersion; //flags the version
- static Double_t fDiffT; //Transversal diffusion constant
- static Double_t fDiffL; //Longitudinal diffusion constant
- static Double_t fOmegaTau; //ExB effects
- static Double_t fInnerPadLength;
- static Double_t fOuter1PadLength;
- static Double_t fOuter2PadLength;
- static Double_t fInnerPRFSigma;
- static Double_t fOuter1PRFSigma;
- static Double_t fOuter2PRFSigma;
- static Double_t fTimeSigma; //Minimal longitudinal width
- static Int_t fADCSat; //ADC Saturation (1024 = 10 bit)
- static Int_t fZeroSup; //Zero suppression threshold
- static Double_t fCos[36]; //stores the cos value for local to global rotations
- static Double_t fSin[36]; //stores the sin value for local to global rotations
+ static const Double_t fgkBFACT; //bfield
+ static const Double_t fgkPi; //pi
+ static const Double_t fgkPi2; //2pi
+ static const Double_t fgk2Pi; //pi/2
+ static const Double_t fgkAnodeWireSpacing; //anode wire spacing
+ static const Double_t fgkToDeg; //rad to deg
+
+ static Int_t fgNPatches; //6 (dont change this)
+ static Int_t fgRows[6][2]; //rows per patch
+ static Int_t fgNRows[6]; //rows per patch
+
+ static Double_t fgBField; //field
+ static Double_t fgBFieldFactor; //field
+ static Double_t fgSolenoidBField; //field
+ static Int_t fgNTimeBins; //ntimebins
+ static Int_t fgNRowLow; //nrows
+ static Int_t fgNRowUp; //nrows
+ static Int_t fgNRowUp1; //nrows
+ static Int_t fgNRowUp2; //nrows
+ static Int_t fgNSectorLow; //nsector
+ static Int_t fgNSectorUp; //nsector
+ static Int_t fgSlice2Sector[36][2]; //nslice
+ static Int_t fgSector2Slice[72]; //nslice
+ static Int_t fgSectorLow[72]; //nsector
+ static Double_t fgPadPitchWidthLow; //pad pitch
+ static Double_t fgPadPitchWidthUp; //pad pitch
+ static Double_t fgZWidth; //width
+ static Double_t fgZSigma; //sigma
+ static Double_t fgZLength; //length
+ static Double_t fgZOffset; //offset
+ static Int_t fgNSector; //72 (dont change this)
+ static Int_t fgNSlice; //36 (dont change this)
+ static Int_t fgNRow; //159 (dont change this)
+ static Double_t fgNRotShift; //Rotation shift (eg. 0.5 for 10 degrees)
+ static Int_t fgNPads[159]; //fill this following Init and fVersion
+ static Double_t fgX[159]; //X position in local coordinates
+ static Int_t fgVersion; //flags the version
+ static Double_t fgDiffT; //Transversal diffusion constant
+ static Double_t fgDiffL; //Longitudinal diffusion constant
+ static Double_t fgOmegaTau; //ExB effects
+ static Double_t fgInnerPadLength; //innner pad length
+ static Double_t fgOuter1PadLength; //outer pad length
+ static Double_t fgOuter2PadLength; //outer pad length
+ static Double_t fgInnerPRFSigma; //inner pad response function
+ static Double_t fgOuter1PRFSigma; //outer pad response function
+ static Double_t fgOuter2PRFSigma; //outer pad response function
+ static Double_t fgTimeSigma; //Minimal longitudinal width
+ static Int_t fgADCSat; //ADC Saturation (1024 = 10 bit)
+ static Int_t fgZeroSup; //Zero suppression threshold
+ static Double_t fgCos[36]; //stores the cos value for local to global rotations
+ static Double_t fgSin[36]; //stores the sin value for local to global rotations
public:
#ifdef use_aliroot
static Bool_t SaveInitFile(Char_t *filename); //save parameters in init file
//setters
- static void SetNPatches(Int_t i){fNPatches = i;}
- static void SetNRows(Int_t s[6]){for(Int_t i=0;i<fNPatches;i++) fNRows[i] = s[i];}
+ static void SetNPatches(Int_t i){fgNPatches = i;}
+ static void SetNRows(Int_t s[6]){for(Int_t i=0;i<fgNPatches;i++) fgNRows[i] = s[i];}
static void SetRows(Int_t s[6][2]){
- for(Int_t i=0;i<fNPatches;i++){
- fRows[i][0] = s[i][0];
- fRows[i][1] = s[i][1];
+ for(Int_t i=0;i<fgNPatches;i++){
+ fgRows[i][0] = s[i][0];
+ fgRows[i][1] = s[i][1];
}
}
- static void SetBField(Double_t f) {fBField = f;} //careful, these 3 are not independent!
- static void SetBFieldFactor(Double_t f) {fBFieldFactor = f;fBField=fBFieldFactor*fSolenoidBField*0.1;}
- static void SetSolenoidBField(Double_t f){fSolenoidBField = f;fBField=fBFieldFactor*fSolenoidBField*0.1;}
- static void SetNTimeBins(Int_t i){fNTimeBins = i;}
- static void SetNRowLow(Int_t i){fNRowLow = i;}
- static void SetNRowUp(Int_t i){fNRowUp = i;}
- static void SetNRowUp1(Int_t i){fNRowUp1 = i;}
- static void SetNRowUp2(Int_t i){fNRowUp2 = i;}
+ static void SetBField(Double_t f) {fgBField = f;} //careful, these 3 are not independent!
+ static void SetBFieldFactor(Double_t f) {
+ fgBFieldFactor = f;
+ fgBField=fgBFieldFactor*fgSolenoidBField*0.1;
+ }
+ static void SetSolenoidBField(Double_t f){
+ fgSolenoidBField = f;
+ fgBField=fgBFieldFactor*fgSolenoidBField*0.1;
+ }
+ static void SetNTimeBins(Int_t i){fgNTimeBins = i;}
+ static void SetNRowLow(Int_t i){fgNRowLow = i;}
+ static void SetNRowUp(Int_t i){fgNRowUp = i;}
+ static void SetNRowUp1(Int_t i){fgNRowUp1 = i;}
+ static void SetNRowUp2(Int_t i){fgNRowUp2 = i;}
static void SetSlice2Sector(Int_t s[36][2]){
- for(Int_t i=0;i<fNSlice;i++){
- fSlice2Sector[i][0] = s[i][0];
- fSlice2Sector[i][1] = s[i][1];
+ for(Int_t i=0;i<fgNSlice;i++){
+ fgSlice2Sector[i][0] = s[i][0];
+ fgSlice2Sector[i][1] = s[i][1];
}
}
- static void SetSector2Slice(Int_t s[72]){for(Int_t i=0;i<fNSector;i++) fSector2Slice[i] = s[i];}
- static void SetSectorLow(Int_t s[72]){for(Int_t i=0;i<fNSector;i++) fSectorLow[i] = s[i];}
- static void SetNSectorLow(Int_t i){fNSectorLow = i;}
- static void SetNSectorUp(Int_t i){fNSectorUp = i;}
- static void SetPadPitchWidthLow(Double_t f){fPadPitchWidthLow = f;}
- static void SetPadPitchWidthUp(Double_t f){fPadPitchWidthUp = f;}
- static void SetZWidth(Double_t f){fZWidth = f;}
- static void SetZSigma(Double_t f){fZSigma = f;}
- static void SetZLength(Double_t f){fZLength = f;}
- static void SetZOffset(Double_t f){fZOffset = f;}
- static void SetNSector(Int_t i){fNSector = i;}
- static void SetNSlice(Int_t i){fNSlice = i;}
- static void SetNRow(Int_t i){fNRow = i;}
- static void SetNRotShift(Double_t f){fNRotShift = f;}
- static void SetNPads(Int_t pads[159]){for(Int_t i=0;i<fNRow;i++) fNPads[i] = pads[i];}
- static void SetX(Double_t xs[159]){for(Int_t i=0;i<fNRow;i++) fX[i] = xs[i];}
- static void SetVersion(Int_t i){fVersion = i;}
- static void SetDiffT(Double_t f){fDiffT = f;}
- static void SetDiffL(Double_t f){fDiffL = f;}
- static void SetOmegaTau(Double_t f){fOmegaTau = f;}
- static void SetInnerPadLength(Double_t f){fInnerPadLength = f;}
- static void SetOuter1PadLength(Double_t f){fOuter1PadLength = f;}
- static void SetOuter2PadLength(Double_t f){fOuter2PadLength = f;}
- static void SetInnerPRFSigma(Double_t f){fInnerPRFSigma = f;}
- static void SetOuter1PRFSigma(Double_t f){fOuter1PRFSigma = f;}
- static void SetOuter2PRFSigma(Double_t f){fOuter2PRFSigma = f;}
- static void SetTimeSigma(Double_t f){fTimeSigma = f;}
- static void SetADCSat(Int_t i) {fADCSat = i;}
- static void SetZeroSup(Int_t i) {fZeroSup = i;}
+ static void SetSector2Slice(Int_t s[72]){
+ for(Int_t i=0;i<fgNSector;i++) fgSector2Slice[i] = s[i];}
+ static void SetSectorLow(Int_t s[72]){
+ for(Int_t i=0;i<fgNSector;i++) fgSectorLow[i] = s[i];}
+ static void SetNSectorLow(Int_t i){fgNSectorLow = i;}
+ static void SetNSectorUp(Int_t i){fgNSectorUp = i;}
+ static void SetPadPitchWidthLow(Double_t f){fgPadPitchWidthLow = f;}
+ static void SetPadPitchWidthUp(Double_t f){fgPadPitchWidthUp = f;}
+ static void SetZWidth(Double_t f){fgZWidth = f;}
+ static void SetZSigma(Double_t f){fgZSigma = f;}
+ static void SetZLength(Double_t f){fgZLength = f;}
+ static void SetZOffset(Double_t f){fgZOffset = f;}
+ static void SetNSector(Int_t i){fgNSector = i;}
+ static void SetNSlice(Int_t i){fgNSlice = i;}
+ static void SetNRow(Int_t i){fgNRow = i;}
+ static void SetNRotShift(Double_t f){fgNRotShift = f;}
+ static void SetNPads(Int_t pads[159]){
+ for(Int_t i=0;i<fgNRow;i++) fgNPads[i] = pads[i];}
+ static void SetX(Double_t xs[159]){
+ for(Int_t i=0;i<fgNRow;i++) fgX[i] = xs[i];}
+ static void SetVersion(Int_t i){fgVersion = i;}
+ static void SetDiffT(Double_t f){fgDiffT = f;}
+ static void SetDiffL(Double_t f){fgDiffL = f;}
+ static void SetOmegaTau(Double_t f){fgOmegaTau = f;}
+ static void SetInnerPadLength(Double_t f){fgInnerPadLength = f;}
+ static void SetOuter1PadLength(Double_t f){fgOuter1PadLength = f;}
+ static void SetOuter2PadLength(Double_t f){fgOuter2PadLength = f;}
+ static void SetInnerPRFSigma(Double_t f){fgInnerPRFSigma = f;}
+ static void SetOuter1PRFSigma(Double_t f){fgOuter1PRFSigma = f;}
+ static void SetOuter2PRFSigma(Double_t f){fgOuter2PRFSigma = f;}
+ static void SetTimeSigma(Double_t f){fgTimeSigma = f;}
+ static void SetADCSat(Int_t i) {fgADCSat = i;}
+ static void SetZeroSup(Int_t i) {fgZeroSup = i;}
//getters
static const Char_t* GetParamName() {return "75x40_100x60_150x60";}
- static const Double_t Pi() {return fPi;}
- static const Double_t PiHalf() {return fPi2;}
- static const Double_t TwoPi() {return f2Pi;}
- static const Double_t GetAnodeWireSpacing() {return fAnodeWireSpacing;}
- static const Double_t GetBFact() {return fBFACT;}
- static const Double_t ToRad() {return 1./fToDeg;}
- static const Double_t ToDeg() {return fToDeg;}
+ static const Double_t Pi() {return fgkPi;}
+ static const Double_t PiHalf() {return fgkPi2;}
+ static const Double_t TwoPi() {return fgk2Pi;}
+ static const Double_t GetAnodeWireSpacing() {return fgkAnodeWireSpacing;}
+ static const Double_t GetBFact() {return fgkBFACT;}
+ static const Double_t ToRad() {return 1./fgkToDeg;}
+ static const Double_t ToDeg() {return fgkToDeg;}
static Int_t GetFirstRow(Int_t patch);
static Int_t GetLastRow(Int_t patch);
static Int_t GetNRows(Int_t patch);
static Int_t GetPatch(Int_t padrow);
- static Int_t GetNRows() {return fNRow;}
- static Int_t GetNRowLow() {return fNRowLow;}
- static Int_t GetNRowUp1() {return fNRowUp1;}
- static Int_t GetNRowUp2() {return fNRowUp2;}
+ static Int_t GetNRows() {return fgNRow;}
+ static Int_t GetNRowLow() {return fgNRowLow;}
+ static Int_t GetNRowUp1() {return fgNRowUp1;}
+ static Int_t GetNRowUp2() {return fgNRowUp2;}
static Int_t GetPadRow(Float_t x);
- static Int_t GetNPatches() {return fNPatches;}
+ static Int_t GetNPatches() {return fgNPatches;}
static Int_t GetNPads(Int_t row);
- static Int_t GetNTimeBins(){return fNTimeBins;}
- static Double_t GetBField() {return fBField;}
- static Double_t GetSolenoidField() {return fSolenoidBField;}
- static Double_t GetBFactFactor() {return fBFieldFactor;}
- static Double_t GetBFieldValue() {return (fBField*fBFACT);}
- static Float_t Deg2Rad(Float_t angle) {return angle/fToDeg;}
- static Float_t Rad2Deg(Float_t angle) {return angle*fToDeg;}
- static Int_t GetVersion(){return fVersion;}
- static Double_t GetPadPitchWidthLow() {return fPadPitchWidthLow;}
- static Double_t GetPadPitchWidthUp() {return fPadPitchWidthUp;}
+ static Int_t GetNTimeBins(){return fgNTimeBins;}
+ static Double_t GetBField() {return fgBField;}
+ static Double_t GetSolenoidField() {return fgSolenoidBField;}
+ static Double_t GetBFactFactor() {return fgBFieldFactor;}
+ static Double_t GetBFieldValue() {return (fgBField*fgkBFACT);}
+ static Float_t Deg2Rad(Float_t angle) {return angle/fgkToDeg;}
+ static Float_t Rad2Deg(Float_t angle) {return angle*fgkToDeg;}
+ static Int_t GetVersion(){return fgVersion;}
+ static Double_t GetPadPitchWidthLow() {return fgPadPitchWidthLow;}
+ static Double_t GetPadPitchWidthUp() {return fgPadPitchWidthUp;}
static Double_t GetPadPitchWidth(Int_t patch);
- static Double_t GetZWidth() {return fZWidth;}
- static Double_t GetZLength() {return fZLength;}
- static Double_t GetZOffset() {return fZOffset;}
- static Double_t GetDiffT() {return fDiffT;}
- static Double_t GetDiffL() {return fDiffL;}
+ static Double_t GetZWidth() {return fgZWidth;}
+ static Double_t GetZLength() {return fgZLength;}
+ static Double_t GetZOffset() {return fgZOffset;}
+ static Double_t GetDiffT() {return fgDiffT;}
+ static Double_t GetDiffL() {return fgDiffL;}
static Double_t GetParSigmaY2(Int_t padrow,Float_t z,Float_t angle);
static Double_t GetParSigmaZ2(Int_t padrow,Float_t z,Float_t tgl);
- static Double_t GetOmegaTau() {return fOmegaTau;}
+ static Double_t GetOmegaTau() {return fgOmegaTau;}
static Double_t GetPadLength(Int_t padrow);
static Double_t GetPRFSigma(Int_t padrow);
- static Double_t GetTimeSigma() {return fTimeSigma;}
- static Double_t GetZSigma() {return fZSigma;}
- static Int_t GetADCSat() {return fADCSat;}
- static Int_t GetZeroSup() {return fZeroSup;}
- static Int_t GetNSlice() {return fNSlice;}
- static Int_t GetNSector() {return fNSector;}
- static Int_t GetNSectorLow() {return fNSectorLow;}
- static Int_t GetNSectorUp() {return fNSectorUp;}
+ static Double_t GetTimeSigma() {return fgTimeSigma;}
+ static Double_t GetZSigma() {return fgZSigma;}
+ static Int_t GetADCSat() {return fgADCSat;}
+ static Int_t GetZeroSup() {return fgZeroSup;}
+ static Int_t GetNSlice() {return fgNSlice;}
+ static Int_t GetNSector() {return fgNSector;}
+ static Int_t GetNSectorLow() {return fgNSectorLow;}
+ static Int_t GetNSectorUp() {return fgNSectorUp;}
static Bool_t Slice2Sector(Int_t slice, Int_t slicerow, Int_t §or, Int_t &row);
static Bool_t Sector2Slice(Int_t &slice, Int_t sector);
*/
ClassImp(AliL3VertexArray)
-void AliL3VertexArray::AnalyzeSector(Float_t *vertex, Int_t *array, Int_t len){
-//loop over all seeds and all vertex position
+void AliL3VertexArray::AnalyzeSector(Float_t *vertex, Int_t *array, Int_t len)
+{
+ //loop over all seeds and all vertex position
LOG(AliL3Log::kInformational,"AliL3VertexArray::AnalyzeSector","Analyze")
<<AliL3Log::kDec<<"Number of Seeds: "<<fNSeed<<ENDLOG;
for(Int_t i =0;i<fNSeed;i++)
array[bin] += Trace(fZSeed[i],fRSeed[i],fSecSeed[i],vertex[bin]);
}
-void AliL3VertexArray::FindSectorVertex(Double_t pos, Double_t range, Int_t nbin){
-//define position and range for search and
-//loop over all seeds
-//and find position of vertex and error
- const Int_t len = nbin;
- const Double_t width = range;
- const Double_t xmin = pos - width/2;
- const Double_t step = width/len;
- const Double_t start = xmin + step/2.;
- Int_t * array = new Int_t[len];
- Float_t * ver = new Float_t[len];
- for(Int_t i=0;i<len;i++){
- ver[i] = start + step * i;
+void AliL3VertexArray::FindSectorVertex(Double_t pos, Double_t range, Int_t nbin)
+{
+ //define position and range for search and
+ //loop over all seeds
+ //and find position of vertex and error
+ const Int_t klen = nbin;
+ const Double_t kwidth = range;
+ const Double_t kxmin = pos - kwidth/2;
+ const Double_t kstep = kwidth/klen;
+ const Double_t kstart = kxmin + kstep/2.;
+ Int_t * array = new Int_t[klen];
+ Float_t * ver = new Float_t[klen];
+ for(Int_t i=0;i<klen;i++){
+ ver[i] = kstart + kstep * i;
array[i] = 0;
}
- AnalyzeSector(ver,array,len);
- FindMean(ver,array,len);
+ AnalyzeSector(ver,array,klen);
+ FindMean(ver,array,klen);
delete[] array;
delete[] ver;
}
-void AliL3VertexArray::FindMean(Float_t *vertex,Int_t *array, Int_t len){
-//find mean and error of array and store it in
-//fZSector and fZSectorErr
- const Int_t nbin = len;
+void AliL3VertexArray::FindMean(Float_t *vertex,Int_t *array, Int_t len)
+{
+ //find mean and error of array and store it in
+ //fZSector and fZSectorErr
+ const Int_t knbin = len;
Int_t xbin =0;
Int_t max=0;
- for(Int_t i = 0;i<nbin;i++){
+ for(Int_t i = 0;i<knbin;i++){
if(array[i]>max){
max = array[i];
xbin =i;
}
xmax = xbin;
while(xmax++){
- if(xmax>=nbin) {ops++;break;}
+ if(xmax>=knbin) {ops++;break;}
if(array[xmax]<hmax){
break;
}
}
if(ops){
- if(xbin >= nbin/2){xmin = 2 * xbin - nbin +1;xmax = nbin-1;}
+ if(xbin >= knbin/2){xmin = 2 * xbin - knbin +1;xmax = knbin-1;}
else{xmin = 0;xmax = 2 * xbin;}
}
Double_t sumw=0;
}
else{fZSectorErr = fZSector = 0;}
sumw=sumw2=sumwx=sumwx2=0;
- for(Int_t bin = 0;bin<nbin;bin++){
+ for(Int_t bin = 0;bin<knbin;bin++){
sumw += array[bin];
sumw2 += array[bin] * array[bin];
sumwx += array[bin] * vertex[bin];
#include <math.h>
#include "AliL3RootTypes.h"
-class AliL3VertexArray{
+class AliL3VertexArray {
private:
- Char_t fArray[8320][8][8];
- Double_t fZSector;
- Double_t fZSectorErr;
- Int_t fMaxSeed;
- Int_t fNSeed;
- Float_t fZSeed[400];
- Float_t fRSeed[400];
- Int_t fSecSeed[400];
+ Char_t fArray[8320][8][8]; //array
+ Double_t fZSector; //sector
+ Double_t fZSectorErr; //sector error
+ Int_t fMaxSeed; //max seed
+ Int_t fNSeed; //number of seeds
+ Float_t fZSeed[400]; //seed in Z
+ Float_t fRSeed[400]; //seed in XY
+ Int_t fSecSeed[400]; //seed for sectors
void FindMean(Float_t *vertex,Int_t *array, Int_t len);
void AnalyzeSector(Float_t *vertex, Int_t *array, Int_t len);
};
-inline void AliL3VertexArray::FillSector3D(Float_t x, Float_t y, Float_t z){
+inline void AliL3VertexArray::FillSector3D(Float_t x, Float_t y, Float_t z)
+{
// Filling routine in coordinates
Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
Float_t r = sqrt(pow(y,2)+pow(x,2));
FillSector2D(z,r,sec);
}
-inline void AliL3VertexArray:: FillSectorSeed3D(Float_t x,Float_t y, Float_t z){
+inline void AliL3VertexArray:: FillSectorSeed3D(Float_t x,Float_t y, Float_t z)
+{
// Filling routine for seeds in coordinates
Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
Float_t r = sqrt(pow(y,2)+pow(x,2));
FillSectorSeed2D(z,r,sec);
}
-inline void AliL3VertexArray::FillSectorSeed2D(Float_t z,Float_t r,Int_t sec){
+inline void AliL3VertexArray::FillSectorSeed2D(Float_t z,Float_t r,Int_t sec)
+{
// Filling routine in r,z coordinates
if(fNSeed>=400) return;
fZSeed[fNSeed] = z; fRSeed[fNSeed] = r; fSecSeed[fNSeed] = sec;
fNSeed++;
}
-inline void AliL3VertexArray::FillSector2D(Float_t z,Float_t r,Int_t sec){
+inline void AliL3VertexArray::FillSector2D(Float_t z,Float_t r,Int_t sec)
+{
// Filling routine for seeds in r,z coordinates
if(z>r||z<=0||r<220||r>=252) return;
fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec] += 1;
}
-inline Int_t AliL3VertexArray::GetContent(Float_t z,Float_t r,Int_t sec){
+inline Int_t AliL3VertexArray::GetContent(Float_t z,Float_t r,Int_t sec)
+{
// Return content of array in r,z coordinates
if(z>r||z<=0||r<220||r>=252) return 0;
return fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec];
}
-inline void AliL3VertexArray::ResetSector(){
+inline void AliL3VertexArray::ResetSector()
+{
// do it!
fZSector=0;
fZSectorErr=0;
fArray[z][r][sec] = 0;
}
-inline Int_t AliL3VertexArray::Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex){
+inline Int_t AliL3VertexArray::Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex)
+{
// count the number of entries along starting from z,r to vertex,0
Int_t cont=0;
for(Int_t i = 0;i<8;i++){
ClassImp(AliLevel3)
-Bool_t AliLevel3::fDoVertexFit = kTRUE;//Include the vertex in the final track fit
+Bool_t AliLevel3::fgDoVertexFit = kTRUE;//Include the vertex in the final track fit
AliLevel3::AliLevel3()
{
void AliLevel3::Init(Char_t *path,EFileType filetype,Int_t npatches)
{
+ //Init the whole standard tracker chain
#ifndef use_newio
if (filetype==kRunLoader){
LOG(AliL3Log::kError,"AliLevel3::Init","Files")
fBenchmark = new AliL3Benchmark();
}
-void AliLevel3::DoBench(char* name){
+void AliLevel3::DoBench(char* name)
+{
+ //dobench
fBenchmark->Analyze(name);
delete fBenchmark;
fBenchmark = new AliL3Benchmark();
}
-void AliLevel3::DoMc(char* file){
+void AliLevel3::DoMc(char* file)
+{
+ //domc
#ifdef use_aliroot
if(!fFileHandler->IsDigit(fEvent))
fFileHandler->SetMCOutput(file);
#endif
}
-AliLevel3::~AliLevel3(){
+AliLevel3::~AliLevel3()
+{
//Destructor
if(fVertexFinder) delete fVertexFinder;
if(fVertex) delete fVertex;
}
void AliLevel3::SetClusterFinderParam(Float_t fXYError, Float_t fZError, Bool_t deconv)
-{
+{
+ //set cluster finder parameter
fXYClusterError=fXYError;
fZClusterError=fZError;
fClusterDeconv=deconv;
void AliLevel3::SetMergerParameters(Double_t maxy,Double_t maxz,Double_t maxkappa,Double_t maxpsi,Double_t maxtgl)
{
+ //set global merger parameter
fGlobalMerger->SetParameter(maxy,maxz,maxkappa,maxpsi,maxtgl);
}
-void AliLevel3::ProcessEvent(Int_t first,Int_t last,Int_t event){
+void AliLevel3::ProcessEvent(Int_t first,Int_t last,Int_t event)
+{
//Do tracking on all slices in region [first,last]
//Slices numbering in TPC goes from 0-35, which means that one slice
//corresponds to inner+outer sector.E.g. slice 2 corresponds to
fFileHandler->FreeDigitsTree();
}
-void AliLevel3::ProcessSlice(Int_t slice){
+void AliLevel3::ProcessSlice(Int_t slice)
+{
+ //process slice
char name[256];
Bool_t UseCF = kFALSE;
#ifdef use_aliroot
if(fNoCF == kTRUE) //In case you don't want to run with cluster finder
UseCF = kFALSE;
- const Int_t maxpoints=120000;
- const Int_t pointsize = maxpoints * sizeof(AliL3SpacePointData);
+ const Int_t kmaxpoints=120000;
+ const Int_t kpointsize = kmaxpoints * sizeof(AliL3SpacePointData);
AliL3MemHandler *memory = new AliL3MemHandler();
fTrackMerger->Reset();
#endif
}//end else UseBinary
- points = (AliL3SpacePointData *) memory->Allocate(pointsize);
+ points = (AliL3SpacePointData *) memory->Allocate(kpointsize);
fClusterFinder = new AliL3ClustFinderNew();
- fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1],maxpoints);
+ fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1],kmaxpoints);
fClusterFinder->SetDeconv(fClusterDeconv);
fClusterFinder->SetXYError(fXYClusterError);
fClusterFinder->SetZError(fZClusterError);
}
void AliLevel3::FitGlobalTracks()
-{
+{
+ //fit global tracks
AliL3Fitter *fitter = new AliL3Fitter(fVertex,AliLevel3::DoVertexFit());
if(fNPatch==1)
fitter->LoadClusters(fWriteOutPath,fEvent,kTRUE);
}
void AliLevel3::WriteSpacePoints(UInt_t npoints,AliL3SpacePointData *points,
- Int_t slice,Int_t patch)
-{
+ Int_t slice,Int_t patch) const
+{
+ //write space points
char name[256];
if(fNPatch==1)
sprintf(name,"%s/points_%d_%d_%d.raw",fWriteOutPath,fEvent,slice,-1);
delete memory;
}
-Int_t AliLevel3::WriteTracks(char *filename,AliL3Merger *merger,char opt)
-{
+Int_t AliLevel3::WriteTracks(char *filename,AliL3Merger *merger,char opt) const
+{
+ //write tracks
AliL3MemHandler *memory = new AliL3MemHandler();
memory->SetBinaryOutput(filename);
if(opt=='a'||opt=='i'){ //add intracks
}
memory->CloseBinaryOutput();
-
+ delete memory;
return 1;
}
#endif
private:
- UInt_t fNTrackData;
+ UInt_t fNTrackData; //count data
AliL3TrackSegmentData* fTrackData; //!
AliL3ConfMapper *fTracker; //!
AliL3Vertex *fVertex; //!
AliL3MemHandler *fFileHandler; //!
AliL3Benchmark *fBenchmark;//!
- Int_t fEvent;
- Int_t fNPatch;
- Int_t fRow[6][2];
- Float_t fEta[2];
+ Int_t fEvent; //event number
+ Int_t fNPatch; //number of patches
+ Int_t fRow[6][2];//rows
+ Float_t fEta[2]; //eta
Char_t *fInputFile;//!
#ifdef use_newio
- AliRunLoader *fRunLoader;
+ AliRunLoader *fRunLoader; //runloader
#endif
- Char_t fPath[256];
- Char_t fWriteOutPath[256];
+ Char_t fPath[256]; //path to aliroot
+ Char_t fWriteOutPath[256]; //path to store
- Bool_t fDoRoi;
- Bool_t fFindVertex;
- Bool_t fDoNonVertex;
- Bool_t fPileUp;
- Bool_t fNoCF;
+ Bool_t fDoRoi; //do region of interest
+ Bool_t fFindVertex; //find vertex
+ Bool_t fDoNonVertex;//do non vertex pass
+ Bool_t fPileUp; //do pileup
+ Bool_t fNoCF; //dont do cluster finder
- Bool_t fUseBinary;
- Bool_t fWriteOut;
+ Bool_t fUseBinary; //use binary input
+ Bool_t fWriteOut; //write tracks
- static Bool_t fDoVertexFit;
-
- Bool_t fClusterDeconv;
- Float_t fXYClusterError;
- Float_t fZClusterError;
+ static Bool_t fgDoVertexFit; //do vertex fix
+ Bool_t fClusterDeconv; //do cluster deconv
+ Float_t fXYClusterError; //Cluster error
+ Float_t fZClusterError; //Cluster error
void WriteSpacePoints(UInt_t npoints,AliL3SpacePointData *points,
- Int_t slice,Int_t patch);
- Int_t WriteTracks(char *filename,AliL3Merger *merger,char opt='o');
+ Int_t slice,Int_t patch) const;
+ Int_t WriteTracks(char *filename,AliL3Merger *merger,char opt='o') const;
void WriteResults();
void FitGlobalTracks();
void SetPath(char *p){sprintf(fPath,"%s",p);}
void DoRoi(Float_t e0=0.4,Float_t e1=0.5){fEta[0]=e0;fEta[1]=e1;fDoRoi=kTRUE;}
void WriteFiles(Char_t *path="./"){fWriteOut = kTRUE; sprintf(fWriteOutPath,"%s",path);}
- static void SetVertexFit(Bool_t f) {fDoVertexFit=f;}
- static Bool_t DoVertexFit() {return fDoVertexFit;}
+ static void SetVertexFit(Bool_t f) {fgDoVertexFit=f;}
+ static Bool_t DoVertexFit() {return fgDoVertexFit;}
ClassDef(AliLevel3,1) //Interface class for Level3-tracking
};