* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
$Log$
+Revision 1.3 2006/03/31 13:49:07 arcelli
+Removing some junk printout
+
Revision 1.2 2006/03/31 11:26:30 arcelli
changing CDB Ids according to standard convention
}
//_____________________________________________________________________________
-void AliTOFAlignment::Smear( Float_t *tr, Float_t *rot){
-
+void AliTOFAlignment::Smear( Float_t *tr, Float_t *rot)
+{
+ //Introduce Random Offset/Tilts
fTOFAlignObjArray = new TObjArray(kMaxAlignObj);
Float_t dx, dy, dz; // shifts
Float_t dpsi, dtheta, dphi; // angular displacements
TRandom *rnd = new TRandom(1567);
TString path;
- const char *SM71="/ALIC_1/B077_1/B071_"; //1-13
+ const char *sSM71="/ALIC_1/B077_1/B071_"; //1-13
const char *sm71="/BTO1_1";
- const char *SM74="/ALIC_1/B077_1/B074_"; //1-2
+ const char *sSM74="/ALIC_1/B077_1/B074_"; //1-2
const char *sm74="/BTO2_1";
- const char *SM75="/ALIC_1/B077_1/B075_"; //1-3
+ const char *sSM75="/ALIC_1/B077_1/B075_"; //1-3
const char *sm75="/BTO3_1";
dtheta = rot[1]/nSM71;
dphi = rot[2]/nSM71;
- path = SM71;
+ path = sSM71;
path += i;
path += sm71;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
dtheta = rot[1]/nSM74;
dphi = rot[2]/nSM74;
- path = SM74;
+ path = sSM74;
path += i;
path += sm74;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
dtheta = rot[1]/nSM75;
dphi = rot[2]/nSM75;
- path = SM75;
+ path = sSM75;
path += i;
path += sm75;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
}
//_____________________________________________________________________________
-void AliTOFAlignment::Align( Float_t *tr, Float_t *rot){
+void AliTOFAlignment::Align( Float_t *tr, Float_t *rot)
+{
+ //Introduce Offset/Tilts
fTOFAlignObjArray = new TObjArray(kMaxAlignObj);
Float_t dx, dy, dz; // shifts
Float_t dpsi, dtheta, dphi; // angular displacements
TString path;
- const char *SM71="/ALIC_1/B077_1/B071_"; //1-13
+ const char *sSM71="/ALIC_1/B077_1/B071_"; //1-13
const char *sm71="/BTO1_1";
- const char *SM74="/ALIC_1/B077_1/B074_"; //1-2
+ const char *sSM74="/ALIC_1/B077_1/B074_"; //1-2
const char *sm74="/BTO2_1";
- const char *SM75="/ALIC_1/B077_1/B075_"; //1-3
+ const char *sSM75="/ALIC_1/B077_1/B075_"; //1-3
const char *sm75="/BTO3_1";
dtheta = rot[1]/nSM71;
dphi = rot[2]/nSM71;
- path = SM71;
+ path = sSM71;
path += i;
path += sm71;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
dtheta = rot[1]/nSM74;
dphi = rot[2]/nSM74;
- path = SM74;
+ path = sSM74;
path += i;
path += sm74;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
dtheta = rot[1]/nSM75;
dphi = rot[2]/nSM75;
- path = SM75;
+ path = sSM75;
path += i;
path += sm75;
AliAlignObjAngles *o =new AliAlignObjAngles(path, dvoluid, dx, dy, dz, dpsi, dtheta, dphi);
AliInfo(Form("Number of Alignable Volumes: %d",fNTOFAlignObj));
}
//_____________________________________________________________________________
-void AliTOFAlignment::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){
+void AliTOFAlignment::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
+{
+ //Write Align Par on CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "AlignPar" ;
man->Put(fTOFAlignObjArray,idTOFAlign,mdTOFAlign);
}
//_____________________________________________________________________________
-void AliTOFAlignment::ReadParFromCDB(Char_t *sel, Int_t nrun){
+void AliTOFAlignment::ReadParFromCDB(Char_t *sel, Int_t nrun)
+{
+ //Read Align Par from CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "AlignPar" ;
}
//_____________________________________________________________________________
-void AliTOFAlignment::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){
+void AliTOFAlignment::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
+{
+ //Write Sim Align Par on CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "AlignSimPar" ;
}
//_____________________________________________________________________________
void AliTOFAlignment::ReadSimParFromCDB(Char_t *sel, Int_t nrun){
+ //Read Sim Align Par from CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "AlignSimPar" ;
}
//_____________________________________________________________________________
-void AliTOFAlignment::WriteOnCDBforDC(){
+void AliTOFAlignment::WriteOnCDBforDC()
+{
+ //Write Align Par on CDB for DC06
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
AliCDBId idTOFAlign("TOF/Align/Data",0,0);
man->Put(fTOFAlignObjArray,idTOFAlign,mdTOFAlign);
}
//_____________________________________________________________________________
-void AliTOFAlignment::ReadFromCDBforDC(){
+void AliTOFAlignment::ReadFromCDBforDC()
+{
+ //Read Sim Align Par from CDB for DC06
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
AliCDBEntry *entry = man->Get("TOF/Align/Data",0);
/*
$Log$
+Revision 1.3 2006/03/28 14:56:48 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCal::AliTOFCal():TObject(){
+ //main ctor
fGeom = 0x0;
fNSector = 0;
fNPlate = 0;
//________________________________________________________________
AliTOFCal::AliTOFCal(AliTOFGeometry *geom):TObject(){
+ //ctor with geom
fGeom = geom;
fNSector = fGeom->NSectors();
fNPlate = fGeom->NPlates();
AliTOFCal::AliTOFCal(const AliTOFCal& cal):
TObject(cal)
{
+ //copy ctor
fNSector = cal.fNSector;
fNPlate = cal.fNPlate;
fNStripA = cal.fNStripA;
//____________________________________________________________________________
AliTOFCal::~AliTOFCal()
{
+ //dtor
gROOT->GetListOfBrowsables()->Remove(this);
delete [] fPads;
}
void AliTOFCal::Browse(TBrowser *b)
{
+ //add cal obj to list of browsables
char name[10];
for(Int_t i=0; i<fNSector; ++i) {
snprintf(name,sizeof(name),"Sector %2.2d",i);
//________________________________________________________________
void AliTOFCal::CreateArray(){
+ //create cal channel array
if(fGeom==0x0){
AliInfo("V5 TOF Geometry is taken as a default");
AliTOFGeometry *geom= new AliTOFGeometryV5();
/*
$Log$
+Revision 1.3 2006/03/28 14:57:30 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom){
+ //ctor with TOF geometry
fCh = 0;
fGeom = geom;
fNpadX = fGeom->NpadX();
AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch):
fCh(ch)
{
+ //ctor with TOF geometry and cal channel
fGeom = geom;
fNpadX = fGeom->NpadX();
}
void AliTOFCalPadZ::Browse(TBrowser *b)
{
+ //Add cal object to browsable list
if(fGeom==0x0){
AliInfo("V5 TOF Geometry is taken as the default");
AliTOFGeometry *geom = new AliTOFGeometryV5();
/*
$Log$
+Revision 1.3 2006/03/28 14:57:40 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCalPlateA::AliTOFCalPlateA(){
+ //main ctor
fCh = 0;
fGeom= 0x0;
fNStripA = 0;
AliTOFCalPlateA::AliTOFCalPlateA(AliTOFChannel *ch) : fCh(ch)
{
+ //ctor with channel
fGeom= 0x0;
fNStripA = 0;
fNpadZ = 0;
//________________________________________________________________
AliTOFCalPlateA::AliTOFCalPlateA(AliTOFGeometry *geom){
+ //ctor with geom
fCh = 0;
fGeom = geom;
fNStripA = fGeom->NStripA();
AliTOFCalPlateA::AliTOFCalPlateA(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch)
{
+ //ctor with geom and channel
fGeom = geom;
fNStripA = fGeom->NStripA();
fNpadZ = fGeom->NpadZ();
AliTOFCalPlateA::~AliTOFCalPlateA()
{
+ //dtor
delete[] fCh;
}
AliTOFCalPlateA::AliTOFCalPlateA(const AliTOFCalPlateA& pl):
TObject(pl)
{
+ //copy ctor
fCh = pl.fCh;
fNStripA = pl.fNStripA;
fNpadZ = pl.fNpadZ;
//________________________________________________________________
void AliTOFCalPlateA::Browse(TBrowser *b){
+ //add cal obj to list of browsables
if(fGeom==0x0){
AliTOFGeometry *geom = new AliTOFGeometryV5();
/*
$Log$
+Revision 1.3 2006/03/28 14:57:48 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCalPlateB::AliTOFCalPlateB(){
+ //main ctor
fCh = 0;
fGeom= 0x0;
fNStripB = 0;
AliTOFCalPlateB::AliTOFCalPlateB(AliTOFChannel *ch) : fCh(ch)
{
+ //ctor with channel
fGeom= 0x0;
fNStripB = 0;
fNpadZ = 0;
//________________________________________________________________
AliTOFCalPlateB::AliTOFCalPlateB(AliTOFGeometry *geom){
+ //ctor with geom
fCh = 0;
fGeom = geom;
fNStripB = fGeom->NStripB();
AliTOFCalPlateB::AliTOFCalPlateB(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch)
{
+ //ctor with channel and geom
fGeom = geom;
fNStripB = fGeom->NStripB();
fNpadZ = fGeom->NpadZ();
AliTOFCalPlateB::~AliTOFCalPlateB()
{
+ //dtor
delete[] fCh;
}
AliTOFCalPlateB::AliTOFCalPlateB(const AliTOFCalPlateB& pl):
TObject(pl)
{
+ //copy ctor
fCh = pl.fCh;
fNStripB = pl.fNStripB;
fNpadZ = pl.fNpadZ;
//________________________________________________________________
void AliTOFCalPlateB::Browse(TBrowser *b){
+ //add cal obj to list of browsables
if(fGeom==0x0){
AliTOFGeometry *geom = new AliTOFGeometryV5();
/*
$Log$
+Revision 1.3 2006/03/28 14:57:56 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCalPlateC::AliTOFCalPlateC(){
+ //main ctor
fCh = 0;
fGeom= 0x0;
fNStripC = 0;
AliTOFCalPlateC::AliTOFCalPlateC(AliTOFChannel *ch) : fCh(ch)
{
+ //ctor with channel
fGeom= 0x0;
fNStripC = 0;
fNpadZ = 0;
//________________________________________________________________
AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom){
+ //ctor with geom
fCh = 0;
fGeom = geom;
fNStripC = fGeom->NStripC();
AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch)
{
+ //ctor with channel and geom
fGeom = geom;
fNStripC = fGeom->NStripC();
fNpadZ = fGeom->NpadZ();
AliTOFCalPlateC::~AliTOFCalPlateC()
{
+ //dtor
delete[] fCh;
}
AliTOFCalPlateC::AliTOFCalPlateC(const AliTOFCalPlateC& pl):
TObject(pl)
{
+ //copy ctor
fCh = pl.fCh;
fNStripC = pl.fNStripC;
fNpadZ = pl.fNpadZ;
//________________________________________________________________
void AliTOFCalPlateC::Browse(TBrowser *b){
+ //add cal obj to list of browsables
if(fGeom==0x0){
AliTOFGeometry *geom = new AliTOFGeometryV5();
/*
$Log$
+Revision 1.3 2006/03/28 14:58:16 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 16:53:00 decaro
just Fixing Log info
//________________________________________________________________
AliTOFCalSector::AliTOFCalSector(){
+ //main ctor
fCh = 0;
fGeom=0x0;
fNPlate=0;
AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch):
fCh(ch)
{
+ //ctor with channel
fGeom=0x0;
fNPlate=0;
fNStripA=0;
//________________________________________________________________
AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){
+ //ctor with geom
fCh = 0;
fGeom= geom;
fNPlate = fGeom->NPlates();
AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch):
fCh(ch)
{
+ // ctor with channel and geom
fGeom= geom;
fNPlate = fGeom->NPlates();
fNStripA = fGeom->NStripA();
AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec):
TObject(sec)
{
+ //copy ctor
fCh = sec.fCh;
fNPlate = sec.fNPlate;
fNStripA = sec.fNStripA;
AliTOFCalSector::~AliTOFCalSector()
{
+ //dtor
gROOT->GetListOfBrowsables()->Remove(this);
delete[] fCh;
}
//________________________________________________________________
void AliTOFCalSector::Browse(TBrowser *b){
-
+ //add cal obj to list of browsables
if(fGeom==0x0){
AliTOFGeometry *geom= new AliTOFGeometryV5();
AliInfo("V5 TOF Geometry is taken as the default");
/*
$Log$
+Revision 1.3 2006/03/28 14:58:08 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFCalStrip::AliTOFCalStrip(){
+ //main ctor
fCh = 0;
fGeom= 0x0;
fNpadZ = 0;
AliTOFCalStrip::AliTOFCalStrip(AliTOFChannel *ch):
fCh(ch)
{
+ // ctor with channel
fGeom= 0x0;
fNpadZ = 0;
fNpadX = 0;
//________________________________________________________________
AliTOFCalStrip::AliTOFCalStrip(AliTOFGeometry *geom){
+ //ctor with geom
fCh = 0;
fGeom = geom;
fNpadZ = fGeom->NpadZ();
AliTOFCalStrip::AliTOFCalStrip(AliTOFGeometry *geom,AliTOFChannel *ch):
fCh(ch)
{
+ //ctor with channel and geom
fGeom = geom;
fNpadZ = fGeom->NpadZ();
fNpadX = fGeom->NpadX();
AliTOFCalStrip::~AliTOFCalStrip()
{
+ //dtor
delete[] fCh;
}
AliTOFCalStrip::AliTOFCalStrip(const AliTOFCalStrip& strip):
TObject(strip)
{
+ //copy ctor
fCh = strip.fCh;
fNpadZ = strip.fNpadZ;
fNpadX = strip.fNpadX;
//________________________________________________________________
void AliTOFCalStrip::Browse(TBrowser *b){
-
+ //add obj to list of browsables
if(fGeom==0x0){
AliTOFGeometry *geom = new AliTOFGeometryV5();
AliInfo("V5 TOF Geometry is taken as the default");
Int_t dig[5];
Float_t g[3];
Double_t h[5];
- Float_t ToT;
- Double_t TdcND;
+ Float_t tToT;
+ Double_t tTdcND;
for (ii=0; ii<nDigits; ii++) {
AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
dig[0]=d->GetSector();
h[2] = g[2];
h[3] = d->GetTdc();
h[4] = d->GetAdc();
- ToT = d->GetToT();
- TdcND = d->GetTdcND();
+ tToT = d->GetToT();
+ tTdcND = d->GetTdcND();
- AliTOFcluster *tofCluster = new AliTOFcluster(h,d->GetTracks(),dig,ii,ToT, TdcND);
+ AliTOFcluster *tofCluster = new AliTOFcluster(h,d->GetTracks(),dig,ii,tToT, tTdcND);
InsertCluster(tofCluster);
}
Int_t detectorIndex[5];
Float_t position[3];
Double_t cylindricalPosition[5];
- Float_t ToT;
- Double_t TdcND;
+ Float_t tToT;
+ Double_t tTdcND;
for (indexDDL = 0; indexDDL < kDDL; indexDDL++) {
cylindricalPosition[2] = position[2];
cylindricalPosition[3] = tofInput.GetTofBin();
cylindricalPosition[4] = tofInput.GetADCbin();
- ToT = tofInput.GetADCbin();
- TdcND = -1.;
+ tToT = tofInput.GetADCbin();
+ tTdcND = -1.;
AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex);
- tofCluster->SetToT(ToT);
- tofCluster->SetTDCND(TdcND);
+ tofCluster->SetToT(tToT);
+ tofCluster->SetTDCND(tTdcND);
InsertCluster(tofCluster);
} // while loop
Int_t detectorIndex[5];
Float_t position[3];
Double_t cylindricalPosition[5];
- Float_t ToT;
- Double_t TdcND;
+ Float_t tToT;
+ Double_t tTdcND;
for (indexDDL = 0; indexDDL < kDDL; indexDDL++) {
cylindricalPosition[2] = (Double_t)position[2];
cylindricalPosition[3] = (Double_t)tofInput.GetTofBin();
cylindricalPosition[4] = (Double_t)tofInput.GetADCbin();
- ToT = tofInput.GetADCbin();
- TdcND = -1.;
+ tToT = tofInput.GetADCbin();
+ tTdcND = -1.;
AliTOFcluster *tofCluster = new AliTOFcluster(cylindricalPosition, detectorIndex);
- tofCluster->SetToT(ToT);
- tofCluster->SetTDCND(TdcND);
+ tofCluster->SetToT(tToT);
+ tofCluster->SetTDCND(tTdcND);
InsertCluster(tofCluster);
} // while loop
Double_t cylindricalPosition[5];
Int_t trackLabels[3];
Int_t digitIndex = -1;
- Float_t ToT;
- Double_t TdcND;
+ Float_t tToT;
+ Double_t tTdcND;
TClonesArray &lRecPoints = *fRecPoints;
cylindricalPosition[2] = fTofClusters[ii]->GetZ();
cylindricalPosition[3] = fTofClusters[ii]->GetTDC();
cylindricalPosition[4] = fTofClusters[ii]->GetADC();
- ToT = fTofClusters[ii]->GetToT();
- TdcND = fTofClusters[ii]->GetTDCND();
+ tToT = fTofClusters[ii]->GetToT();
+ tTdcND = fTofClusters[ii]->GetTDCND();
- new(lRecPoints[ii]) AliTOFcluster(cylindricalPosition, trackLabels, detectorIndex, digitIndex, ToT, TdcND);
+ new(lRecPoints[ii]) AliTOFcluster(cylindricalPosition, trackLabels, detectorIndex, digitIndex, tToT, tTdcND);
//AliInfo(Form("%3i %3i %f %f %f %f %f %2i %2i %2i %1i %2i",ii,digitIndex, cylindricalPosition[2],cylindricalPosition[0],cylindricalPosition[1],cylindricalPosition[3],cylindricalPosition[4],detectorIndex[0],detectorIndex[1],detectorIndex[2],detectorIndex[3],detectorIndex[4]));
Int_t detectorIndex[5];
Int_t digitIndex = -1;
- Float_t ToT;
- Float_t TdcCorr;
+ Float_t tToT;
+ Float_t tdcCorr;
AliInfo(" Calibrating TOF Clusters: ")
AliTOFcalib *calib = new AliTOFcalib(fTOFGeometry);
calib->ReadParFromCDB("TOF/Calib",0);
- AliTOFCal *TOFCalArray = calib->GetTOFCalArray();
+ AliTOFCal *calTOFArray = calib->GetTOFCalArray();
for (ii=0; ii<fNumberOfTofClusters; ii++) {
digitIndex = fTofClusters[ii]->GetIndex();
Int_t index = calib->GetIndex(detectorIndex);
- AliTOFChannel * CalChannel = TOFCalArray->GetChannel(index);
+ AliTOFChannel * calChannel = calTOFArray->GetChannel(index);
Float_t par[6];
for (Int_t j = 0; j<6; j++){
- par[j]=CalChannel->GetSlewPar(j);
+ par[j]=calChannel->GetSlewPar(j);
}
- ToT = fTofClusters[ii]->GetToT();
- Float_t TimeCorr=par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT;
- TdcCorr=(fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()+32)*1.E-3-TimeCorr;
- TdcCorr=(TdcCorr*1E3-32)/AliTOFGeometry::TdcBinWidth();
- fTofClusters[ii]->SetTDC(TdcCorr);
+ tToT = fTofClusters[ii]->GetToT();
+ Float_t timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT;
+ tdcCorr=(fTofClusters[ii]->GetTDC()*AliTOFGeometry::TdcBinWidth()+32)*1.E-3-timeCorr;
+ tdcCorr=(tdcCorr*1E3-32)/AliTOFGeometry::TdcBinWidth();
+ fTofClusters[ii]->SetTDC(tdcCorr);
} // loop on clusters
#define ALITOFCLUSTERFINDER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+// AliTOFClusterFinder Class
+// Task: Transform digits/raw data to TOF Clusters, to fill TOF RecPoints
+// and feed TOF tracking
#include "AliRawReader.h"
AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager)
:AliDigitizer(manager)
{
+ //ctor with RunDigitizer
fDigits=0;
fSDigitsArray=0;
fhitMap=0;
}
//_____________________________________________________________________________
-void AliTOFDigitizer::InitDecalibration( AliTOFcalib *calib){
+void AliTOFDigitizer::InitDecalibration( AliTOFcalib *calib) const {
calib->ReadSimParFromCDB("TOF/Calib", 0);
}
//---------------------------------------------------------------------
AliInfo(Form("Size of AliTOFCal = %i",cal->NPads()));
for (Int_t ipad = 0 ; ipad<cal->NPads(); ipad++){
- AliTOFChannel *CalChannel = cal->GetChannel(ipad);
+ AliTOFChannel *calChannel = cal->GetChannel(ipad);
Float_t par[6];
for (Int_t j = 0; j<6; j++){
- par[j]=CalChannel->GetSlewPar(j);
+ par[j]=calChannel->GetSlewPar(j);
}
}
TH1F * hToT= calib->GetTOFSimToT();
Int_t nbins = hToT->GetNbinsX();
- Float_t Delta = hToT->GetBinWidth(1);
- Float_t maxch = hToT->GetBinLowEdge(nbins)+Delta;
+ Float_t delta = hToT->GetBinWidth(1);
+ Float_t maxch = hToT->GetBinLowEdge(nbins)+delta;
Float_t minch = hToT->GetBinLowEdge(1);
Float_t max=0,min=0; //maximum and minimum value of the distribution
Int_t maxbin=0,minbin=0; //maximum and minimum bin of the distribution
for (Int_t ii=nbins; ii>0; ii--){
if (hToT->GetBinContent(ii)!= 0) {
- max = maxch - (nbins-ii-1)*Delta;
+ max = maxch - (nbins-ii-1)*delta;
maxbin = ii;
break;}
}
for (Int_t j=1; j<nbins; j++){
if (hToT->GetBinContent(j)!= 0) {
- min = minch + (j-1)*Delta;
+ min = minch + (j-1)*delta;
minbin = j;
break;}
}
- Float_t MaxToT=max;
- Float_t MinToT=min;
- Float_t MaxToTDistr=hToT->GetMaximum();
+ Float_t maxToT=max;
+ Float_t minToT=min;
+ Float_t maxToTDistr=hToT->GetMaximum();
// Loop on TOF Digits
if(hToT->GetEntries()>0){
Float_t trix = 0;
Float_t triy = 0;
- Float_t SimToT = 0;
- while (SimToT <= triy){
+ Float_t simToT = 0;
+ while (simToT <= triy){
trix = gRandom->Rndm(i);
triy = gRandom->Rndm(i);
- trix = (MaxToT-MinToT)*trix + MinToT;
- triy = MaxToTDistr*triy;
+ trix = (maxToT-minToT)*trix + minToT;
+ triy = maxToTDistr*triy;
Int_t binx=hToT->FindBin(trix);
- SimToT=hToT->GetBinContent(binx);
+ simToT=hToT->GetBinContent(binx);
}
// Setting realistic ToT signal (only for Miscalibrated Data)
dig->SetToT(trix);
}
Int_t index = calib->GetIndex(detId);
- AliTOFChannel *CalChannel = cal->GetChannel(index);
+ AliTOFChannel *calChannel = cal->GetChannel(index);
Float_t par[6];
for (Int_t j = 0; j<6; j++){
- par[j]=CalChannel->GetSlewPar(j);
+ par[j]=calChannel->GetSlewPar(j);
if(par[j]!=0)dbEntry=kTRUE;
}
- Float_t ToT= dig->GetToT();
+ Float_t tToT= dig->GetToT();
dig->SetTdcND(dig->GetTdc());
Float_t tdc = ((dig->GetTdc())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3; //tof signal in ns
- Float_t timeoffset=par[0] + ToT*par[1] +ToT*ToT*par[2] +ToT*ToT*ToT*par[3] +ToT*ToT*ToT*ToT*par[4] +ToT*ToT*ToT*ToT*ToT*par[5];
+ Float_t timeoffset=par[0] + tToT*par[1] +tToT*tToT*par[2] +tToT*tToT*tToT*par[3] +tToT*tToT*tToT*tToT*par[4] +tToT*tToT*tToT*tToT*tToT*par[5];
Float_t timeSlewed = tdc + timeoffset;
// Setting Decalibrated Time signal
dig->SetTdc((timeSlewed*1E3-32)/AliTOFGeometry::TdcBinWidth());
// Do the main work
void Exec(Option_t* option=0) ;
TClonesArray* SDigits() const {return fSDigitsArray;}
- void ReadSDigit(Int_t);
+ void ReadSDigit(Int_t inputFile);
void CreateDigits();
- void InitDecalibration(AliTOFcalib *calib);
+ void InitDecalibration(AliTOFcalib *calib) const;
void DecalibrateTOFSignal(AliTOFcalib *calib);
private:
void CollectSDigit(AliTOFSDigit * sdigit) ;
- Int_t PutNoise(Int_t /*charge*/){return 0;}; // not yet implemented
+ Int_t PutNoise(Int_t /*charge*/)const {return 0;}; // not yet implemented
// due to the low noise expected level
AliTOFGeometry *fGeom; // AliTOFgeometry pointer
TClonesArray *fDigits; //! array with digits
/*
$Log$
+Revision 1.13 2006/03/12 14:37:54 arcelli
+ Changes for TOF Reconstruction using TGeo
+
Revision 1.12 2006/02/28 10:38:00 decaro
AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
// AliTOFGeometry default constructor
//
- kNStripC = 20; // number of strips in C type module
+ kNStripC = 19; // number of strips in C type module
kZlenA = 106.0; // length (cm) of the A module
kZlenB = 141.0; // length (cm) of the B module
kZlenC = 177.5; // length (cm) of the C module
static Int_t NStripA() { return kNStripA;};
static Int_t NStripB() { return kNStripB;};
- virtual Int_t NStripC() { return kNStripC;};
+ virtual Int_t NStripC() const { return kNStripC;};
static Int_t NMaxNstrip() { return kMaxNstrip;};
static Int_t NpadX() { return kNpadX;};
static Int_t NpadZ() { return kNpadZ;};
static Int_t NpadXStrip() { return kNpadX*kNpadZ;};
static Int_t NSectors() { return kNSectors;};
static Int_t NPlates() { return kNPlates;};
- virtual Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
+ virtual Int_t NPadXSector() const { return (kNStripA + 2*kNStripB +
2*kNStripC)*kNpadX*kNpadZ;};
- virtual Float_t RinTOF() { return fgkxTOF;};
- virtual Float_t Rmin() { return fgkRmin;};
- virtual Float_t Rmax() { return fgkRmax;};
+ virtual Float_t RinTOF() const { return fgkxTOF;};
+ virtual Float_t Rmin() const { return fgkRmin;};
+ virtual Float_t Rmax() const { return fgkRmax;};
- static Float_t XPad() { return fgkXPad;};
- static Float_t ZPad() { return fgkZPad;};
+ static Float_t XPad() { return fgkXPad;};
+ static Float_t ZPad() { return fgkZPad;};
static Float_t StripLength() { return fgkStripLength;};
static Int_t NCh() { return kNCh;};
static Int_t NPadXTRM() { return kNCh*kNTdc;};
- virtual Float_t ZlenA() { return kZlenA;};
- virtual Float_t ZlenB() { return kZlenB;};
- virtual Float_t ZlenC() { return kZlenC;};
- virtual Float_t MaxhZtof() { return kMaxhZtof;};
+ virtual Float_t ZlenA() const { return kZlenA;};
+ virtual Float_t ZlenB() const { return kZlenB;};
+ virtual Float_t ZlenC() const { return kZlenC;};
+ virtual Float_t MaxhZtof() const { return kMaxhZtof;};
static Float_t SigmaForTail1() { return fgkSigmaForTail1;};
static Float_t SigmaForTail2() { return fgkSigmaForTail2;};
Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos);
Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0);
void GetVolumePath(Int_t *ind, Char_t *path );
- Int_t GetPlate(Float_t *pos);
+ Int_t GetPlate(Float_t *pos) ;
Int_t GetStrip(Float_t *pos);
Int_t GetSector(Float_t *pos);
Int_t GetPadX(Float_t *pos);
Float_t GetMaxStripTheta(Int_t iPlate, Int_t iStrip);
Float_t GetStripTheta(Int_t iPlate, Int_t iStrip);
- Float_t NStirpC() { return kNStripC;};
- Int_t NPadXSector() { return (AliTOFGeometry::kNStripA + 2*AliTOFGeometry::kNStripB +
+ Int_t NStripC() const { return kNStripC;};
+ Int_t NPadXSector() const { return (AliTOFGeometry::kNStripA + 2*AliTOFGeometry::kNStripB +
2*kNStripC)*AliTOFGeometry::kNpadX*AliTOFGeometry::kNpadZ;};
- Float_t RinTOF() { return fgkxTOF;};
- Float_t Rmin() { return fgkRmin;};
- Float_t Rmax() { return fgkRmax;};
+ Float_t RinTOF() const { return fgkxTOF;};
+ Float_t Rmin() const { return fgkRmin;};
+ Float_t Rmax() const { return fgkRmax;};
- Float_t ZlenA() { return fgkZlenA;};
- Float_t ZlenB() { return fgkZlenB;};
- Float_t ZlenC() { return fgkZlenC;};
- Float_t MaxhZtof() { return fgkMaxhZtof;};
+ Float_t ZlenA() const { return fgkZlenA;};
+ Float_t ZlenB() const { return fgkZlenB;};
+ Float_t ZlenC() const { return fgkZlenC;};
+ Float_t MaxhZtof() const { return fgkMaxhZtof;};
static Float_t DeadBndX() { return fgkDeadBndX;};
static Float_t DeadBndZ() { return fgkDeadBndZ;};
Float_t GetPadDy(Float_t *pos);
Float_t GetPadDz(Float_t *pos);
- Float_t NStirpC() { return kNStripC;};
- Int_t NPadXSector() { return (AliTOFGeometry::kNStripA + 2*AliTOFGeometry::kNStripB +
+ Int_t NStripC() const { return kNStripC;};
+ Int_t NPadXSector() const { return (AliTOFGeometry::kNStripA + 2*AliTOFGeometry::kNStripB +
2*kNStripC)*AliTOFGeometry::kNpadX*AliTOFGeometry::kNpadZ;};
- Float_t RinTOF() { return fgkxTOF;};
- Float_t Rmin() { return fgkRmin;};
- Float_t Rmax() { return fgkRmax;};
+ Float_t RinTOF() const { return fgkxTOF;};
+ Float_t Rmin() const { return fgkRmin;};
+ Float_t Rmax() const { return fgkRmax;};
- Float_t ZlenA() { return fgkZlenA;};
- Float_t ZlenB() { return fgkZlenB;};
- Float_t ZlenC() { return fgkZlenC;};
- Float_t MaxhZtof() { return fgkMaxhZtof;};
+ Float_t ZlenA() const { return fgkZlenA;};
+ Float_t ZlenB() const { return fgkZlenB;};
+ Float_t ZlenC() const { return fgkZlenC;};
+ Float_t MaxhZtof() const { return fgkMaxhZtof;};
void Translation(Float_t *xyz, Float_t translationVector[3]);
void Rotation(Float_t *xyz, Double_t rotationAngles[6]);
//____________________________________________________________________________
AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_t nEvents):TTask("TOFSDigitizer","")
{
+ //ctor, reading from input file
ftail = 0;
fSelectedSector=-1; // by default we sdigitize all sectors
fSelectedPlate =-1; // by default we sdigitize all plates in all sectors
//____________________________________________________________________________
void AliTOFSDigitizer::Exec(Option_t *verboseOption) {
-
+ //execute TOF sdigitization
if (strstr(verboseOption,"tim") || strstr(verboseOption,"all"))
gBenchmark->Start("TOFSDigitizer");
//__________________________________________________________________
void AliTOFSDigitizer::SelectSectorAndPlate(Int_t sector, Int_t plate)
{
+ //Select sector and plate
Bool_t isaWrongSelection=(sector < 0) || (sector >= AliTOFGeometry::NSectors()) || (plate < 0) || (plate >= AliTOFGeometry::NPlates());
if(isaWrongSelection){
AliError("You have selected an invalid value for sector or plate ");
/*
$Log$
+Revision 1.4 2006/03/31 11:26:46 arcelli
+ changing CDB Ids according to standard convention
+
Revision 1.3 2006/03/28 14:57:02 arcelli
updates to handle new V5 geometry & some re-arrangements
const Int_t AliTOFcalib::fgkchannel = 5000;
//_______________________________________________________________________
AliTOFcalib::AliTOFcalib():TTask("AliTOFcalib",""){
-
+ //TOF Calibration Class ctor
fArrayToT = 0x0;
fArrayTime = 0x0;
fESDsel = 0x0;
fTOFSimCal = new AliTOFCal(geom);
fTOFCal->CreateArray();
fTOFSimCal->CreateArray();
+ fTOFSimToT=0x0;
delete geom;
}
//_______________________________________________________________________
AliTOFcalib::AliTOFcalib(AliTOFGeometry *geom):TTask("AliTOFcalib",""){
+ //TOF Calibration Class ctor, taking the TOF geometry as input
fArrayToT = 0x0;
fArrayTime = 0x0;
fESDsel = 0x0;
fTOFSimCal = new AliTOFCal(geom);
fTOFCal->CreateArray();
fTOFSimCal->CreateArray();
+ fTOFSimToT=0x0;
}
//____________________________________________________________________________
AliTOFcalib::AliTOFcalib(const AliTOFcalib & calib):TTask("AliTOFcalib","")
{
+ //TOF Calibration Class copy ctor
fNSector = calib.fNSector;
fNPlate = calib.fNPlate;
fNStripA = calib.fNStripA;
fArrayTime = calib.fArrayTime;
fTOFCal=calib.fTOFCal;
fTOFSimCal = calib.fTOFSimCal;
+ fTOFSimToT=calib.fTOFSimToT;
}
//____________________________________________________________________________
AliTOFcalib::~AliTOFcalib()
{
+ //TOF Calibration Class dtor
delete fArrayToT;
delete fArrayTime;
delete fTOFCal;
}
//__________________________________________________________________________
-TF1* AliTOFcalib::SetFitFunctions(TH1F *histo){
+TF1* AliTOFcalib::SetFitFunctions(TH1F *histo)
+{
+ //Define Fit Functions for Slewing Correction
TF1 * fpol[3];
- const Int_t nbins = histo->GetNbinsX();
- Float_t Delta = histo->GetBinWidth(1); //all the bins have the same width
- Double_t max = histo->GetBinLowEdge(nbins)+Delta;
+ const Int_t knbins = histo->GetNbinsX();
+ Float_t delta = histo->GetBinWidth(1); //all the bins have the same width
+ Double_t max = histo->GetBinLowEdge(knbins)+delta;
max = 15;
fpol[0]=new TF1("poly3","pol3",5,max);
fpol[1]=new TF1("poly4","pol4",5,max);
char npoly[10];
Double_t chi[3]={1E6,1E6,1E6};
Int_t ndf[3]={-1,-1,-1};
- Double_t Nchi[3]={1E6,1E6,1E6};
+ Double_t nchi[3]={1E6,1E6,1E6};
Double_t bestchi=1E6;
TF1 * fGold=0x0;
Int_t nonzero =0;
Int_t numberOfpar =0;
- for (Int_t j=0; j<nbins; j++){
+ for (Int_t j=0; j<knbins; j++){
if (histo->GetBinContent(j)!=0) {
nonzero++;
}
histo->Fit(npoly, "ERN", " ", 5.,14.);
chi[ifun] = fpol[ifun]->GetChisquare();
ndf[ifun] = fpol[ifun]->GetNDF();
- Nchi[ifun] = (Double_t)chi[ifun]/ndf[ifun];
- if (Nchi[ifun]<bestchi) {
- bestchi=Nchi[ifun];
+ nchi[ifun] = (Double_t)chi[ifun]/ndf[ifun];
+ if (nchi[ifun]<bestchi) {
+ bestchi=nchi[ifun];
fGold = fpol[ifun];
numberOfpar = fGold->GetNpar();
}
void AliTOFcalib::SelectESD(AliESD *event)
{
- Float_t LowerMomBound=0.8; // [GeV/c] default value Pb-Pb
- Float_t UpperMomBound=1.8 ; // [GeV/c] default value Pb-Pb
+ //track selection for Calibration
+ Float_t lowerMomBound=0.8; // [GeV/c] default value Pb-Pb
+ Float_t upperMomBound=1.8 ; // [GeV/c] default value Pb-Pb
Int_t ntrk =0;
Int_t ngoodtrkfinalToT = 0;
ntrk=event->GetNumberOfTracks();
fESDsel = new TObjArray(ntrk);
fESDsel->SetOwner();
- TObjArray UCdatatemp(ntrk);
+ TObjArray uCdatatemp(ntrk);
Int_t ngoodtrk = 0;
Int_t ngoodtrkfinal = 0;
Float_t mintime =1E6;
time*=1.E-3; // tof given in nanoseconds
if(time <= mintime)mintime=time;
Double_t mom=t->GetP();
- if (!(mom<=UpperMomBound && mom>=LowerMomBound))continue;
- UInt_t AssignedTOFcluster=t->GetTOFcluster();//index of the assigned TOF cluster, >0 ?
- if(AssignedTOFcluster==0){ // not matched
+ if (!(mom<=upperMomBound && mom>=lowerMomBound))continue;
+ UInt_t assignedTOFcluster=t->GetTOFcluster();//index of the assigned TOF cluster, >0 ?
+ if(assignedTOFcluster==0){ // not matched
continue;
}
AliTOFcalibESD *unc = new AliTOFcalibESD;
unc->CopyFromAliESD(t);
Double_t c1[15];
unc->GetExternalCovariance(c1);
- UCdatatemp.Add(unc);
+ uCdatatemp.Add(unc);
ngoodtrk++;
}
for (Int_t i = 0; i < ngoodtrk ; i ++){
- AliTOFcalibESD *unc = (AliTOFcalibESD*)UCdatatemp.At(i);
+ AliTOFcalibESD *unc = (AliTOFcalibESD*)uCdatatemp.At(i);
if((unc->GetTOFsignal()-mintime*1.E3)<5.E3){
fESDsel->Add(unc);
ngoodtrkfinal++;
}
//_____________________________________________________________________________
-void AliTOFcalib::CombESDId(){
+void AliTOFcalib::CombESDId()
+{
+ //track PID for calibration
Float_t t0offset=0;
Float_t loffset=0;
Int_t ntracksinset=6;
Float_t sqMomError[6]={0.,0.,0.,0.,0.,0.};
Float_t sqTrackError[6]={0.,0.,0.,0.,0.,0.};
Float_t tracktoflen[6]={0.,0.,0.,0.,0.,0.};
- Float_t TimeResolution = 0.90e-10; // 90 ps by default
- Float_t timeresolutioninns=TimeResolution*(1.e+9); // convert in [ns]
+ Float_t timeResolution = 0.90e-10; // 90 ps by default
+ Float_t timeresolutioninns=timeResolution*(1.e+9); // convert in [ns]
Float_t timezero[6]={0.,0.,0.,0.,0.,0.};
Float_t weightedtimezero[6]={0.,0.,0.,0.,0.,0.};
Float_t besttimezero[6]={0.,0.,0.,0.,0.,0.};
momentum[j]=mom;
}
Float_t t0best=999.;
- Float_t Et0best=999.;
+ Float_t et0best=999.;
Float_t chisquarebest=999.;
for (Int_t i1=0; i1<3;i1++) {
beta[0]=momentum[0]/sqrt(massarray[i1]*massarray[i1]+momentum[0]*momentum[0]);
Float_t sumAllweights=0.;
Float_t meantzero=0.;
- Float_t Emeantzero=0.;
+ Float_t emeantzero=0.;
for (Int_t itz=0; itz<ntracksinset;itz++) {
sqMomError[itz]=
} // end loop for (Int_t itz=0; itz<15;itz++)
meantzero=meantzero/sumAllweights; // it is given in [ns]
- Emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
+ emeantzero=sqrt(1./sumAllweights); // it is given in [ns]
// calculate chisquare
chisquarebest=chisquare;
t0best=meantzero;
- Et0best=Emeantzero;
+ et0best=emeantzero;
} // close if(dummychisquare<=chisquare)
} // end loop on i6
} // end loop on i5
//_____________________________________________________________________________
void AliTOFcalib::CalibrateESD(){
+ //Calibrate selected ESD times
Int_t nelements = fESDsel->GetEntries();
Int_t *number=new Int_t[fNChannels];
fArrayToT = new AliTOFArray(fNChannels);
for (Int_t kk = 0; kk< nfpar; kk++){
par[kk]=fGold->GetParameter(kk);
}
- AliTOFChannel * CalChannel = fTOFCal->GetChannel(i);
- CalChannel->SetSlewPar(par);
+ AliTOFChannel * calChannel = fTOFCal->GetChannel(i);
+ calChannel->SetSlewPar(par);
}
delete[] number;
}
//___________________________________________________________________________
-TH1F* AliTOFcalib::Profile(Int_t ich){
- const Int_t nbinToT = 650;
+TH1F* AliTOFcalib::Profile(Int_t ich)
+{
+ //Prepare histograms for Slewing Correction
+ const Int_t knbinToT = 650;
Int_t nbinTime = 400;
Float_t minTime = -10.5; //ns
Float_t maxTime = 10.5; //ns
Float_t minToT = 7.5; //ns
Float_t maxToT = 40.; //ns
- Float_t DeltaToT = (maxToT-minToT)/nbinToT;
- Double_t mTime[nbinToT+1],mToT[nbinToT+1],meanTime[nbinToT+1], meanTime2[nbinToT+1],ToT[nbinToT+1], ToT2[nbinToT+1],meanToT[nbinToT+1],meanToT2[nbinToT+1],Time[nbinToT+1],Time2[nbinToT+1],xlow[nbinToT+1],sigmaTime[nbinToT+1];
- Int_t n[nbinToT+1], nentrx[nbinToT+1];
- Double_t sigmaToT[nbinToT+1];
- for (Int_t i = 0; i < nbinToT+1 ; i++){
+ Float_t deltaToT = (maxToT-minToT)/knbinToT;
+ Double_t mTime[knbinToT+1],mToT[knbinToT+1],meanTime[knbinToT+1], meanTime2[knbinToT+1],vToT[knbinToT+1], vToT2[knbinToT+1],meanToT[knbinToT+1],meanToT2[knbinToT+1],vTime[knbinToT+1],vTime2[knbinToT+1],xlow[knbinToT+1],sigmaTime[knbinToT+1];
+ Int_t n[knbinToT+1], nentrx[knbinToT+1];
+ Double_t sigmaToT[knbinToT+1];
+ for (Int_t i = 0; i < knbinToT+1 ; i++){
mTime[i]=0;
mToT[i]=0;
n[i]=0;
meanTime[i]=0;
meanTime2[i]=0;
- ToT[i]=0;
- ToT2[i]=0;
+ vToT[i]=0;
+ vToT2[i]=0;
meanToT[i]=0;
meanToT2[i]=0;
- Time[i]=0;
- Time2[i]=0;
+ vTime[i]=0;
+ vTime2[i]=0;
xlow[i]=0;
sigmaTime[i]=0;
sigmaToT[i]=0;
n[i]=0;
nentrx[i]=0;
}
- TH2F* hSlewing = new TH2F("hSlewing", "hSlewing", nbinToT, minToT, maxToT, nbinTime, minTime, maxTime);
+ TH2F* hSlewing = new TH2F("hSlewing", "hSlewing", knbinToT, minToT, maxToT, nbinTime, minTime, maxTime);
TArrayF * parrToT = fArrayToT->GetArray(ich);
TArrayF & refaToT = * parrToT;
TArrayF * parrTime = fArrayTime->GetArray(ich);
TArrayF & refaTime = * parrTime;
for (Int_t j = 0; j < AliTOFcalib::fgkchannel; j++){
if (refaToT[j] == 0) continue;
- Int_t nx = (Int_t)((refaToT[j]-minToT)/DeltaToT)+1;
+ Int_t nx = (Int_t)((refaToT[j]-minToT)/deltaToT)+1;
if ((refaToT[j] != 0) && (refaTime[j] != 0)){
- Time[nx]+=refaTime[j];
- Time2[nx]+=(refaTime[j])*(refaTime[j]);
- ToT[nx]+=refaToT[j];
- ToT2[nx]+=refaToT[j]*refaToT[j];
+ vTime[nx]+=refaTime[j];
+ vTime2[nx]+=(refaTime[j])*(refaTime[j]);
+ vToT[nx]+=refaToT[j];
+ vToT2[nx]+=refaToT[j]*refaToT[j];
nentrx[nx]++;
hSlewing->Fill(refaToT[j],refaTime[j]);
}
}
Int_t nbinsToT=hSlewing->GetNbinsX();
- if (nbinsToT != nbinToT) {
+ if (nbinsToT != knbinToT) {
AliError("Profile :: incompatible numbers of bins");
return 0x0;
}
if (n[usefulBins]==0 && i == nbinsToT) {
break;
}
- meanTime[usefulBins]+=Time[i];
- meanTime2[usefulBins]+=Time2[i];
- meanToT[usefulBins]+=ToT[i];
- meanToT2[usefulBins]+=ToT2[i];
+ meanTime[usefulBins]+=vTime[i];
+ meanTime2[usefulBins]+=vTime2[i];
+ meanToT[usefulBins]+=vToT[i];
+ meanToT2[usefulBins]+=vToT2[i];
if (n[usefulBins]<20 && i!=nbinsToT) continue;
mTime[usefulBins]=meanTime[usefulBins]/n[usefulBins];
mToT[usefulBins]=meanToT[usefulBins]/n[usefulBins];
}
}
for (Int_t i=0;i<usefulBins;i++){
- Int_t binN = (Int_t)((mToT[i]-minToT)/DeltaToT)+1;
+ Int_t binN = (Int_t)((mToT[i]-minToT)/deltaToT)+1;
histo->Fill(mToT[i],mTime[i]);
histo->SetBinError(binN,sigmaTime[i]);
}
}
//_____________________________________________________________________________
-void AliTOFcalib::CorrectESDTime(){
+void AliTOFcalib::CorrectESDTime()
+{
+ //Calculate the corrected TOF time
Int_t nelements = fESDsel->GetEntries();
for (Int_t i=0; i< nelements; i++) {
AliTOFcalibESD *element=(AliTOFcalibESD*)fESDsel->At(i);
Int_t index = element->GetTOFCalChannel();
- Float_t ToT = element->GetToT();
+ Float_t tToT = element->GetToT();
//select the correspondent channel with its simulated ToT spectrum
//summing up everything, index = 0 for all channels:
Int_t ipid = element->GetCombID();
else if (ipid == 1) etime = expTime[3]*1E-3; //ns
else if (ipid == 2) etime = expTime[4]*1E-3; //ns
Float_t par[6];
- AliTOFChannel * CalChannel = fTOFCal->GetChannel(index);
+ AliTOFChannel * calChannel = fTOFCal->GetChannel(index);
for (Int_t j = 0; j<6; j++){
- par[j]=CalChannel->GetSlewPar(j);
+ par[j]=calChannel->GetSlewPar(j);
}
- Float_t TimeCorr=0;
- TimeCorr= par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT;
+ Float_t timeCorr=0;
+ timeCorr= par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT;
}
}
//_____________________________________________________________________________
void AliTOFcalib::CorrectESDTime(AliESD *event){
+ //Calculate the corrected TOF time
Int_t ntrk =0;
ntrk=event->GetNumberOfTracks();
if ((t->GetStatus()&AliESDtrack::kTIME)==0) {
continue;
}
- UInt_t AssignedTOFcluster=t->GetTOFcluster();//index of the assigned TOF cluster, >0 ?
- if(AssignedTOFcluster==0){ // not matched
+ UInt_t assignedTOFcluster=t->GetTOFcluster();//index of the assigned TOF cluster, >0 ?
+ if(assignedTOFcluster==0){ // not matched
continue;
}
Int_t index = t->GetTOFCalChannel();
- AliTOFChannel * CalChannel = fTOFCal->GetChannel(index);
+ AliTOFChannel * calChannel = fTOFCal->GetChannel(index);
Float_t par[6];
for (Int_t j = 0; j<6; j++){
- par[j]=CalChannel->GetSlewPar(j);
+ par[j]=calChannel->GetSlewPar(j);
}
- Float_t ToT = t->GetTOFsignalToT();
- Float_t TimeCorr =0;
- TimeCorr=par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT;
+ Float_t tToT = t->GetTOFsignalToT();
+ Float_t timeCorr =0;
+ timeCorr=par[0]+par[1]*tToT+par[2]*tToT*tToT+par[3]*tToT*tToT*tToT+par[4]*tToT*tToT*tToT*tToT+par[5]*tToT*tToT*tToT*tToT*tToT;
}
}
//_____________________________________________________________________________
-void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){
+void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
+{
+ //Write calibration parameters to the CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "Par" ;
//_____________________________________________________________________________
void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal){
+ //Write calibration parameters to the CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "Par" ;
}
//_____________________________________________________________________________
-void AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun){
+void AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun)
+{
+ //Read calibration parameters from the CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
Char_t *sel1 = "Par" ;
fTOFCal = cal;
}
//_____________________________________________________________________________
-void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){
+void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
+{
+ //Write Sim miscalibration parameters to the CDB
//for the time being, only one spectrum is used
}
for(Int_t iTOFch=0; iTOFch<fTOFSimCal->NPads();iTOFch++){
- AliTOFChannel * CalChannel = fTOFSimCal->GetChannel(iTOFch);
- CalChannel->SetSlewPar(par);
+ AliTOFChannel * calChannel = fTOFSimCal->GetChannel(iTOFch);
+ calChannel->SetSlewPar(par);
}
// Store them in the CDB
//_____________________________________________________________________________
void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F * histo){
+ //Write Sim miscalibration parameters to the CDB
- // Retrieve ToT Spectrum
fTOFSimToT=histo;
fTOFSimCal=cal;
AliCDBManager *man = AliCDBManager::Instance();
man->Put(fTOFSimToT,id2,md);
}
//_____________________________________________________________________________
-void AliTOFcalib::ReadSimParFromCDB(Char_t *sel, Int_t nrun){
+void AliTOFcalib::ReadSimParFromCDB(Char_t *sel, Int_t nrun)
+{
+ //Read miscalibration parameters from the CDB
AliCDBManager *man = AliCDBManager::Instance();
if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
AliCDBMetaData *md = new AliCDBMetaData();
}
//_____________________________________________________________________________
-Int_t AliTOFcalib::GetIndex(Int_t *detId){
+Int_t AliTOFcalib::GetIndex(Int_t *detId)
+{
+ //Retrieve calibration channel index
Int_t isector = detId[0];
if (isector >= fNSector)
AliError(Form("Wrong sector number in TOF (%d) !",isector));
}
Int_t GetSize() const {return fSize;}
void AddArray(Int_t pos, TArrayF * parr) {
- if (pos>-1 && pos < fSize)
- fArray[pos] = parr;
- //else
- //AliError("Index out of range");
- }
- TArrayF * GetArray(Int_t pos) {
- TArrayF * parr = 0x0;
- if (pos>-1 && pos < fSize)
- parr = fArray[pos];
- //else
- //AliError("Index out of range");
+ if (pos>-1 && pos < fSize)fArray[pos] = parr;}
+ TArrayF * GetArray(Int_t pos) const {
+ TArrayF * parr = 0x0;
+ if (pos>-1 && pos < fSize)parr = fArray[pos];
return parr;
}
virtual ~AliTOFArray() {
/*
$Log$
+Revision 1.3 2006/03/28 14:57:13 arcelli
+updates to handle new V5 geometry & some re-arrangements
+
Revision 1.2 2006/02/13 17:22:26 arcelli
just Fixing Log info
//________________________________________________________________
AliTOFcalibESD::AliTOFcalibESD():
- fTOFCalChannel(-1),
+ fTOFCalCh(-1),
fToT(0),
fIntLen(0),
fTOFtime(0),
- fP(0),
+ fMo(0),
fTOFsignalND(0)
{
- for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0;
+ for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = 0;
}
//________________________________________________________________
AliTOFcalibESD::AliTOFcalibESD(const AliTOFcalibESD& UnCalib):
AliESDtrack(UnCalib),
fCombID(UnCalib.fCombID),
- fTOFCalChannel(UnCalib.fTOFCalChannel),
+ fTOFCalCh(UnCalib.fTOFCalCh),
fToT(UnCalib.fToT),
fIntLen(UnCalib.fIntLen),
fTOFtime(UnCalib.fTOFtime),
- fP(UnCalib.fP),
+ fMo(UnCalib.fMo),
fTOFsignalND(UnCalib.fTOFsignalND)
{
- for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = UnCalib.fTrackTime[i];
+ for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = UnCalib.fTrTime[i];
for (Int_t i = 0;i<15;i++) fExtCov[i] = UnCalib.fExtCov[i];
}
//________________________________________________________________
//________________________________________________________________
void AliTOFcalibESD::SetIntegratedTime(const Double_t *tracktime){
- for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = tracktime[i];
+ for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrTime[i] = tracktime[i];
}
//________________________________________________________________
-void AliTOFcalibESD::CopyFromAliESD(const AliESDtrack* track)
-{
- fP = track->GetP();
+void AliTOFcalibESD::CopyFromAliESD(const AliESDtrack* track){
+ //copy ESD track info
+ fMo = track->GetP();
fTOFtime = track->GetTOFsignal();
fToT = track->GetTOFsignalToT();
- fTOFCalChannel = track->GetTOFCalChannel();
+ fTOFCalCh = track->GetTOFCalChannel();
fIntLen = track->GetIntegratedLength();
Double_t exptime[10];
track->GetIntegratedTimes(exptime);
for (Int_t i=0;i<AliPID::kSPECIES;i++) {
- fTrackTime[i] = exptime[i];
+ fTrTime[i] = exptime[i];
}
Double_t c[15];
track->GetExternalCovariance(c);
//______________________________________________________________________
void AliTOFcalibESD::GetIntegratedTimes(Double_t exp[AliPID::kSPECIES]) const {
- for (Int_t i=0; i<AliPID::kSPECIES; i++) exp[i]=fTrackTime[i];
+ for (Int_t i=0; i<AliPID::kSPECIES; i++) exp[i]=fTrTime[i];
}
//______________________________________________________________________
Int_t AliTOFcalibESD::Compare(const TObject* uncobj) const{
+ //To order in momentum
Double_t c1[15];
this->GetExternalCovariance(c1);
Double_t c2[15];
void GetExternalCovariance(Double_t cov[15]) const;
void GetIntegratedTimes(Double_t exp[AliPID::kSPECIES]) const;
Int_t GetCombID()const{return fCombID;}
- Float_t GetP()const{return fP;}
- Int_t GetTOFCalChannel() const {return fTOFCalChannel;}
+ Float_t GetP()const{return fMo;}
+ Int_t GetTOFCalChannel() const {return fTOFCalCh;}
void SetToT(Float_t ToT) {fToT=ToT;}
void SetTOFtime(Float_t TOFtime) {fTOFtime=TOFtime;}
void SetTOFsignalND(Float_t TOFtimeND) {fTOFsignalND=TOFtimeND;}
- void SetP(Double_t p) {fP=p;}
+ void SetP(Double_t p) {fMo=p;}
void SetIntegratedTime(const Double_t *tracktime);
void SetCombID(Int_t ID){fCombID = ID;} // 0->pi, 1->K, 2->p
void SetTOFCalChannel(Int_t index){fTOFCalChannel=index;}
Bool_t IsSortable() const {return kTRUE;}
Int_t Compare(const TObject *uncobj) const;
private:
- Int_t fCombID;
- Int_t fTOFCalChannel;
- Float_t fToT;
- Float_t fIntLen;
- Float_t fTOFtime;
- Double_t fP;
- Float_t fTOFsignalND;
- Double_t fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
- Double_t fExtCov[15];
+ Int_t fCombID; //PID for calibration, this track
+ Int_t fTOFCalCh; //TOF cal Channel
+ Float_t fToT; //ToT signal
+ Float_t fIntLen; //track int. length
+ Float_t fTOFtime;//Time signal
+ Double_t fMo;//momentum
+ Float_t fTOFsignalND; //non-decalibrated time signal
+ Double_t fTrTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
+ Double_t fExtCov[15];// external covariance matrix of the track
ClassDef(AliTOFcalibESD,1);
};