// - RS: Clusters are sorted in Z in roder to have the same numbering as in the ITS reco
// - RS: Clusters used by ESDtrack are flagged, this information is passed to AliMulitiplicity object
// when storing the tracklets and single cluster info
+// - MN: first MC label of single clusters stored
//_________________________________________________________________________
#include <TClonesArray.h>
//____________________________________________________________________
void AliITSMultReconstructor::Reconstruct(AliESDEvent* esd, TTree* treeRP)
-{
- //
- // - calls LoadClusterArrays that finds the position of the clusters
- // (in global coord)
- // - convert the cluster coordinates to theta, phi (seen from the
- // interaction vertex).
- // - makes an array of tracklets
- //
- // After this method has been called, the clusters of the two layers
- // and the tracklets can be retrieved by calling the Get'er methods.
-
+{
if (!treeRP) { AliError(" Invalid ITS cluster tree !\n"); return; }
if (!esd) {AliError("ESDEvent is not available, use old reconstructor"); return;}
// reset counters
void AliITSMultReconstructor::Reconstruct(TTree* clusterTree, Float_t* vtx, Float_t* /* vtxRes*/) {
//
// RS NOTE - this is old reconstructor invocation, to be used from VertexFinder
- //
- // - calls LoadClusterArray that finds the position of the clusters
- // (in global coord)
- // - convert the cluster coordinates to theta, phi (seen from the
- // interaction vertex).
- // - makes an array of tracklets
- //
- // After this method has been called, the clusters of the two layers
- // and the tracklets can be retrieved by calling the Get'er methods.
+
if (fMult) delete fMult; fMult = 0;
fNClustersLay1 = 0;
fNClustersLay2 = 0;
//____________________________________________________________________
void AliITSMultReconstructor::FindTracklets(const Float_t *vtx)
{
+
+ // - calls LoadClusterArrays that finds the position of the clusters
+ // (in global coord)
+ // - convert the cluster coordinates to theta, phi (seen from the
+ // interaction vertex).
+ // - makes an array of tracklets
+ //
+ // After this method has been called, the clusters of the two layers
+ // and the tracklets can be retrieved by calling the Get'er methods.
+
+
// Find tracklets converging to vertex
//
LoadClusterArrays(fTreeRP);
// Loop on layer 1
for (Int_t iC1=0; iC1<fNClustersLay1; iC1++) {
- // already used or in the overlap ?
- if (associatedLay1[iC1] != 0 || fOverlapFlagClustersLay1[iC1]) continue;
+ // already used ?
+ if (associatedLay1[iC1] != 0) continue;
found++;
// Loop on layer 2
for (Int_t iC2=0; iC2<fNClustersLay2; iC2++) {
- // in the overlap ?
- if (fOverlapFlagClustersLay2[iC2]) continue;
float* clPar2 = GetClusterLayer2(iC2);
if (blacklist[iC1]) {
}
// find the difference in angles
- Double_t dTheta = TMath::Abs(clPar2[kClTh] - clPar1[kClTh]);
+ Double_t dTheta = TMath::Abs(clPar2[kClTh] - clPar1[kClTh]);
Double_t dPhi = TMath::Abs(clPar2[kClPh] - clPar1[kClPh]);
// take into account boundary condition
if (dPhi>pi) dPhi=2.*pi-dPhi;
fSClusters[fNSingleCluster] = new Float_t[kClNPar];
fSClusters[fNSingleCluster][kSCTh] = clPar1[kClTh];
fSClusters[fNSingleCluster][kSCPh] = clPar1[kClPh];
+ fSClusters[fNSingleCluster][kSCLab] = clPar1[kClMC0];
fSClusters[fNSingleCluster][kSCID] = iC1;
AliDebug(1,Form(" Adding a single cluster %d (cluster %d of layer 1)",
fNSingleCluster, iC1));
// - store them in the internal arrays
// - count the number of cluster-fired chips
//
- // RS: This method was strongly modified wrt original by Jan Fiete. In order to have the same numbering
+ // RS: This method was strongly modified wrt original. In order to have the same numbering
// of clusters as in the ITS reco I had to introduce sorting in Z
// Also note that now the clusters data are stored not in float[6] attached to float**, but in 1-D array
//____________________________________________________________________
void
AliITSMultReconstructor::LoadClusterFiredChips(TTree* itsClusterTree) {
- // This method
+ // This method
// - gets the clusters from the cluster tree
// - counts the number of (cluster)fired chips
fNFiredChips[0] = 0;
fNFiredChips[1] = 0;
- AliITSsegmentationSPD seg;
+ AliITSsegmentationSPD seg;
AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
TClonesArray* itsClusters=rpcont->FetchClusters(0,itsClusterTree);
if(!rpcont->IsSPDActive()){
//
enum {kClTh,kClPh,kClZ,kClMC0,kClMC1,kClMC2,kClNPar};
enum {kTrTheta,kTrPhi,kTrDPhi,kTrDTheta,kTrLab1,kTrLab2,kClID1,kClID2,kTrNPar};
- enum {kSCTh,kSCPh,kSCID,kSCNPar};
+ enum {kSCTh,kSCPh,kSCLab,kSCID,kSCNPar};
enum {kITSTPC,kITSSAP,kITSTPCBit=BIT(kITSTPC),kITSSAPBit=BIT(kITSSAP)}; // RS
AliITSMultReconstructor();
virtual ~AliITSMultReconstructor();
multReco.LoadClusterFiredChips(itsClusterTree);
Short_t nfcL1 = multReco.GetNFiredChips(0);
Short_t nfcL2 = multReco.GetNFiredChips(1);
- fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,0,nfcL1,nfcL2,fastOrFiredMap);
+ fMult = new AliMultiplicity(0,0,0,0,0,0,0,0,0,0,0,nfcL1,nfcL2,fastOrFiredMap);
fMult->SetFiredChipMap(firedChipMap);
AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance();
fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree));
Int_t nosingleclus=multReco.GetNSingleClusters();
Float_t *ths = new Float_t [nosingleclus];
Float_t *phs = new Float_t [nosingleclus];
+ Int_t *labelss = new Int_t [nosingleclus];
for(Int_t i=0;i<nosingleclus;i++){
ths[i] = multReco.GetCluster(i)[0];
phs[i] = multReco.GetCluster(i)[1];
+ labelss[i] = multReco.GetCluster(i)[2];
}
Short_t nfcL1 = multReco.GetNFiredChips(0);
Short_t nfcL2 = multReco.GetNFiredChips(1);
- fMult = new AliMultiplicity(notracks,tht,phi,dtht,dphi,labels,labelsL2,nosingleclus,ths,phs,nfcL1,nfcL2,fastOrFiredMap);
+ fMult = new AliMultiplicity(notracks,tht,phi,dtht,dphi,labels,labelsL2,nosingleclus,ths,phs,labelss,nfcL1,nfcL2,fastOrFiredMap);
fMult->SetFiredChipMap(firedChipMap);
AliITSRecPointContainer* rcont = AliITSRecPointContainer::Instance();
fMult->SetITSClusters(0,rcont->GetNClustersInLayer(1,itsClusterTree));
delete [] phs;
delete [] labels;
delete [] labelsL2;
+ delete [] labelss;
return;
}
fDeltPhi(0),
fThsingle(0),
fPhisingle(0),
+ fLabelssingle(0),
fFastOrFiredChips(1200),
fClusterFiredChips(1200)
{
}
//______________________________________________________________________
-AliMultiplicity::AliMultiplicity(Int_t ntr, Float_t *th, Float_t *ph, Float_t *dth, Float_t *dph, Int_t *labels, Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOr):
+AliMultiplicity::AliMultiplicity(Int_t ntr, Float_t *th, Float_t *ph, Float_t *dth, Float_t *dph, Int_t *labels, Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Int_t *labelss, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOr):
TObject(),
fNtracks(ntr),
fNsingle(ns),
fDeltPhi(0),
fThsingle(0),
fPhisingle(0),
+ fLabelssingle(0),
fFastOrFiredChips(1200),
fClusterFiredChips(1200)
{
if(ns>0){
fThsingle = new Double_t [ns];
fPhisingle = new Double_t [ns];
+ fLabelssingle = new Int_t [ns];
for(Int_t i=0;i<fNsingle;i++){
fThsingle[i]=ts[i];
fPhisingle[i]=ps[i];
+ fLabelssingle[i]=labelss[i];
}
}
fFiredChips[0] = nfcL1;
fDeltPhi(0),
fThsingle(0),
fPhisingle(0),
+ fLabelssingle(0),
fFastOrFiredChips(1200),
fClusterFiredChips(1200)
{
if(ns>0){
fThsingle = new Double_t [ns];
fPhisingle = new Double_t [ns];
- for(Int_t i=fNsingle;i--;) fThsingle[i] = fPhisingle[i] = 0;
+ fLabelssingle = new Int_t [ns];
+ for(Int_t i=fNsingle;i--;) fThsingle[i] = fPhisingle[i] = fLabelssingle[i] = 0;
}
fFiredChips[0] = nfcL1;
fFiredChips[1] = nfcL2;
fDeltPhi(0),
fThsingle(0),
fPhisingle(0),
+ fLabelssingle(0),
fFastOrFiredChips(1200),
fClusterFiredChips(1200)
{
if(fLabelsL2)delete [] fLabelsL2;fLabelsL2 = 0;
if(fThsingle)delete [] fThsingle;fThsingle = 0;
if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
+ if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
Duplicate(m);
return *this;
if(fNsingle>0){
fThsingle = new Double_t[fNsingle];
fPhisingle = new Double_t[fNsingle];
+ fLabelssingle = new Int_t[fNsingle];
}
else {
fThsingle = 0;
fPhisingle = 0;
+ fLabelssingle = 0;
}
if(m.fTh)memcpy(fTh,m.fTh,fNtracks*sizeof(Double_t));
if(m.fPhi)memcpy(fPhi,m.fPhi,fNtracks*sizeof(Double_t));
if(m.fLabelsL2)memcpy(fLabelsL2,m.fLabelsL2,fNtracks*sizeof(Int_t));
if(m.fThsingle)memcpy(fThsingle,m.fThsingle,fNsingle*sizeof(Double_t));
if(m.fPhisingle)memcpy(fPhisingle,m.fPhisingle,fNsingle*sizeof(Double_t));
-
+ if(m.fLabelssingle)memcpy(fLabelssingle,m.fLabelssingle,fNsingle*sizeof(Int_t));
fFiredChips[0] = m.fFiredChips[0];
fFiredChips[1] = m.fFiredChips[1];
for(Int_t ilayer = 0; ilayer < 6; ilayer++){
if(fLabelsL2)delete [] fLabelsL2;fLabelsL2 = 0;
if(fThsingle)delete [] fThsingle;fThsingle = 0;
if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
-
+ if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
}
//______________________________________________________________________
if(fLabelsL2)delete [] fLabelsL2;fLabelsL2 = 0;
if(fThsingle)delete [] fThsingle;fThsingle = 0;
if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
+ if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
fNtracks = fNsingle = 0;
for (int i=6;i--;) fITSClusters[0] = 0;
fFiredChips[0] = fFiredChips[1] = 0;
Error("SetLabel","Invalid track number %d or layer %d",i,layer);
}
+//______________________________________________________________________
+void AliMultiplicity::SetLabelSingle(Int_t i, Int_t label)
+{
+ if(i>=0 && i<fNsingle) {
+ if (fLabelssingle) {
+ fLabelssingle[i] = label;
+ return;
+ }
+ }
+ Error("SetLabelSingle","Invalid single cluster number %d",i);
+}
+
//______________________________________________________________________
UInt_t AliMultiplicity::GetNumberOfITSClusters(Int_t layMin, Int_t layMax) const {
if (id>=fNsingle) {AliError(Form("Number of declared singles %d < %d",fNsingle,id)); return;}
fThsingle[id] = scl[0];
fPhisingle[id] = scl[1];
+ fLabelssingle[id] = scl[2];
if (bits&BIT(0)) fUsedClusS[0].SetBitNumber(id);
if (bits&BIT(1)) fUsedClusS[1].SetBitNumber(id);
//
}
if (opts.Contains("s")) {
for (int i=0;i<fNsingle;i++)
- printf("S#%3d| Th:%+6.3f Phi:%+6.3f U0:%d U1:%d\n",
- i,fThsingle[i],fPhisingle[i],
+ printf("S#%3d| Th:%+6.3f Phi:%+6.3f L:%4d U0:%d U1:%d\n",
+ i,fThsingle[i],fPhisingle[i],fLabelssingle[i],
FreeClustersTracklet(i,0),FreeClustersTracklet(i,1));
}
//
AliMultiplicity(); // default constructor
// standard constructor
AliMultiplicity(Int_t ntr,Float_t *th, Float_t *ph, Float_t *dth, Float_t *dph, Int_t *labels,
- Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOrFiredChips);
+ Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Int_t *labelss, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOrFiredChips);
AliMultiplicity(Int_t ntr, Int_t ns, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOr);
AliMultiplicity(const AliMultiplicity& m);
AliMultiplicity& operator=(const AliMultiplicity& m);
Int_t GetLabel(Int_t i, Int_t layer) const;
void SetLabel(Int_t i, Int_t layer, Int_t label);
+ Int_t GetLabelSingle(Int_t i) const;
+ void SetLabelSingle(Int_t i, Int_t label);
+
Bool_t FreeClustersTracklet(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNtracks) ? !fUsedClusT[mode].TestBitNumber(i):kFALSE;}
Bool_t FreeSingleCluster(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNsingle) ? !fUsedClusS[mode].TestBitNumber(i):kFALSE;}
Double_t* GetDeltPhi() const {return (Double_t*)fDeltPhi;}
Double_t* GetThetaSingle() const {return (Double_t*)fThsingle;}
Double_t* GetPhiSingle() const {return (Double_t*)fPhisingle;}
- Int_t* GetLabels() const {return (Int_t*)fLabels;}
+ Int_t* GetLabels() const {return (Int_t*)fLabels;}
Int_t* GetLabels2() const {return (Int_t*)fLabelsL2;}
+ Int_t* GetLabelsSingle() const {return (Int_t*)fLabelssingle;}
void SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits);
void SetSingleClusterData(Int_t id, const Float_t* scl,UInt_t bits);
Double32_t *fDeltPhi; //[fNtracks] array with delta phi values
Double32_t *fThsingle; //[fNsingle] array with theta values of L1 clusters
Double32_t *fPhisingle; //[fNsingle] array with phi values of L1 clusters
+ Int_t *fLabelssingle; //[fNsingle] array with labels of clusters in L1 not used for tracklets
Short_t fFiredChips[2]; // Number of fired chips in the two SPD layers
- UInt_t fITSClusters[6]; // Number of ITS cluster per layer
+ UInt_t fITSClusters[6]; // Number of ITS cluster per layer
TBits fFastOrFiredChips; // Map of FastOr fired chips
TBits fClusterFiredChips; // Map of fired chips (= at least one cluster)
TBits fUsedClusT[2]; // flag that at least one of tracklets clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks (1)
TBits fUsedClusS[2]; // flag that the single clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks
- ClassDef(AliMultiplicity,13);
+ ClassDef(AliMultiplicity,14);
};
inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const
}
return -9999;
}
+
+inline Int_t AliMultiplicity::GetLabelSingle(Int_t i) const
+{
+ if(i>=0 && i<fNsingle) {
+ return fLabelssingle[i];
+ } else {
+ Error("GetLabelSingle","Invalid cluster number %d",i); return -9999;
+ }
+ return -9999;
+}
+
+
+
+
#endif