ClassImp(AliPHOSClusterizer)
+AliPHOSCalibData * AliPHOSClusterizer::fgCalibData = 0 ;
+
//____________________________________________________________________________
AliPHOSClusterizer::AliPHOSClusterizer():
fGeom(NULL),
/* History of cvs commits:
*
* $Log$
+ * Revision 1.43 2007/09/26 14:22:17 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
* Revision 1.42 2007/08/28 12:55:07 policheh
* Loaders removed from the reconstruction code (C.Cheshkov)
*
class TTree;
class AliPHOSGeometry;
+class AliPHOSCalibData ;
class AliPHOSClusterizer : public TObject {
protected:
+ static AliPHOSCalibData * fgCalibData ; //! Calibration database if aval.
AliPHOSGeometry *fGeom; // Pointer to PHOS geometry
TClonesArray *fDigitsArr; // Array with input digits
TTree *fTreeR; // Tree with output clusters
/* History of cvs commits:
*
* $Log$
+ * Revision 1.115 2007/09/26 14:22:17 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
* Revision 1.114 2007/09/06 16:06:44 kharlov
* Absence of sorting results in loose of all unfolded clusters
*
AliPHOSClusterizer(),
fDefaultInit(0), fEmcCrystals(0), fToUnfold(0),
fWrite(0), fNumberOfEmcClusters(0), fNumberOfCpvClusters(0),
- fCalibData(0), fADCchanelEmc(0), fADCpedestalEmc(0),
+ fADCchanelEmc(0), fADCpedestalEmc(0),
fADCchanelCpv(0), fADCpedestalCpv(0), fEmcClusteringThreshold(0),
fCpvClusteringThreshold(0), fEmcMinE(0), fCpvMinE(0),
fEmcLocMaxCut(0), fW0(0), fCpvLocMaxCut(0),
AliPHOSClusterizer(geom),
fDefaultInit(0), fEmcCrystals(0), fToUnfold(0),
fWrite(0), fNumberOfEmcClusters(0), fNumberOfCpvClusters(0),
- fCalibData(0), fADCchanelEmc(0), fADCpedestalEmc(0),
+ fADCchanelEmc(0), fADCpedestalEmc(0),
fADCchanelCpv(0), fADCpedestalCpv(0), fEmcClusteringThreshold(0),
fCpvClusteringThreshold(0), fEmcMinE(0), fCpvMinE(0),
fEmcLocMaxCut(0), fW0(0), fCpvLocMaxCut(0),
// Calibration parameters are taken from calibration data base for raw data,
// or from digitizer parameters for simulated data.
- if(fCalibData){
+ if(fgCalibData){
Int_t relId[4];
fGeom->AbsToRelNumbering(absId,relId) ;
Int_t module = relId[0];
Int_t column = relId[3];
Int_t row = relId[2];
if(absId <= fEmcCrystals) { // this is EMC
- fADCchanelEmc = fCalibData->GetADCchannelEmc (module,column,row);
+ fADCchanelEmc = fgCalibData->GetADCchannelEmc (module,column,row);
return amp*fADCchanelEmc ;
}
}
// Calibration parameters are taken from calibration data base for raw data,
// or from digitizer parameters for simulated data.
- if(fCalibData){
+ if(fgCalibData){
Int_t relId[4];
fGeom->AbsToRelNumbering(absId,relId) ;
Int_t module = relId[0];
Int_t column = relId[3];
Int_t row = relId[2];
if(absId > fEmcCrystals) { // this is CPV
- fADCchanelCpv = fCalibData->GetADCchannelCpv (module,column,row);
- fADCpedestalCpv = fCalibData->GetADCpedestalCpv(module,column,row);
+ fADCchanelCpv = fgCalibData->GetADCchannelCpv (module,column,row);
+ fADCpedestalCpv = fgCalibData->GetADCpedestalCpv(module,column,row);
return fADCpedestalCpv + amp*fADCchanelCpv ;
}
}
return ;
}
- GetCalibrationParameters() ;
-
MakeClusters() ;
AliDebug(2,Form(" ---- Printing clusters (%d)\n",
// It is a user responsilibity to open CDB before reconstruction, for example:
// AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB");
- fCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number
- if (fCalibData->GetCalibDataEmc() == 0)
+ if (!fgCalibData)
+ fgCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number
+ if (fgCalibData->GetCalibDataEmc() == 0)
AliFatal("Calibration parameters for PHOS EMC not found. Stop reconstruction.\n");
- if (fCalibData->GetCalibDataCpv() == 0)
+ if (fgCalibData->GetCalibDataCpv() == 0)
AliFatal("Calibration parameters for PHOS CPV not found. Stop reconstruction.\n");
}
if(!gMinuit)
gMinuit = new TMinuit(100);
+ GetCalibrationParameters() ;
+
}
//____________________________________________________________________________
fWrite = kTRUE ;
- fCalibData = 0 ;
-
fIsOldRCUFormat = kFALSE;
}
fW0CPV )) ;
}
//____________________________________________________________________________
-//void AliPHOSClusterizerv1::GetVertex(void)
-//{ //Extracts vertex posisition
-//
- //ESD
-//DP - todo if(){
-//
-// }
-
-// //MC Generator
-// if(gAlice && gAlice->GetMCApp() && gAlice->Generator()){
-// Float_t x,y,z ;
-// gAlice->Generator()->GetOrigin(x,y,z) ;
-// fVtx.SetXYZ(x,y,z) ;
-// return ;
-// }
-//
-// //No any source
-// fVtx[0]=fVtx[1]=fVtx[2]=0. ;
-//
-//}
-//____________________________________________________________________________
void AliPHOSClusterizerv1::PrintRecPoints(Option_t * option)
{
// Prints list of RecPoints produced at the current pass of AliPHOSClusterizer
//For each EMC rec. point set the distance to the nearest bad crystal.
//Author: Boris Polichtchouk
- if(!fCalibData->GetNumOfEmcBadChannels()) return;
- AliInfo(Form("%d bad channel(s) found.\n",fCalibData->GetNumOfEmcBadChannels()));
+ if(!fgCalibData->GetNumOfEmcBadChannels()) return;
+ AliInfo(Form("%d bad channel(s) found.\n",fgCalibData->GetNumOfEmcBadChannels()));
Int_t badIds[8000];
- fCalibData->EmcBadChannelIds(badIds);
+ fgCalibData->EmcBadChannelIds(badIds);
AliPHOSEmcRecPoint* rp;
rp = (AliPHOSEmcRecPoint*)fEMCRecPoints->At(iRP);
minDist = 1.e+07;
- for(Int_t iBad=0; iBad<fCalibData->GetNumOfEmcBadChannels(); iBad++) {
+ for(Int_t iBad=0; iBad<fgCalibData->GetNumOfEmcBadChannels(); iBad++) {
rp->GetGlobalPosition(gposRecPoint,gmat);
fGeom->RelPosInAlice(badIds[iBad],gposBadChannel);
AliDebug(2,Form("BC position:[%.3f,%.3f,%.3f], RP position:[%.3f,%.3f,%.3f]. E=%.3f\n",
/* History of cvs commits:
*
* $Log$
+ * Revision 1.53 2007/08/28 12:55:07 policheh
+ * Loaders removed from the reconstruction code (C.Cheshkov)
+ *
* Revision 1.52 2007/08/07 14:16:00 kharlov
* Quality assurance added (Yves Schutz)
*
class AliPHOSDigit ;
class AliPHOSDigitizer ;
class AliPHOSGeometry ;
-class AliPHOSCalibData ;
class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
Int_t fNumberOfCpvClusters ; // number of CPV clusters found
//Calibration parameters
- AliPHOSCalibData * fCalibData ; //! Calibration database if aval.
Float_t fADCchanelEmc ; // width of one ADC channel in GeV
Float_t fADCpedestalEmc ; //
Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
}
fGeom = AliPHOSGeometry::GetInstance("IHEP","");
-}
+}
//____________________________________________________________________________
AliPHOSReconstructor::~AliPHOSReconstructor()
// write tracks to the ESD
AliPHOSTrackSegmentMaker *tsm = new AliPHOSTrackSegmentMakerv1(fGeom);
- AliPHOSPID *pid = new AliPHOSPIDv1(fGeom);
-
+ AliPHOSPID *pid = new AliPHOSPIDv1 (fGeom);
+
// do current event; the loop over events is done by AliReconstruction::Run()
tsm->SetESD(esd) ;
tsm->SetInput(clustersTree);
TClonesArray *recParticles = pid->GetRecParticles();
Int_t nOfRecParticles = recParticles->GetEntries();
-
esd->SetNumberOfPHOSClusters(nOfRecParticles) ;
esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ;
//######################################
+ // Read digits array
+ TBranch *branch = digitsTree->GetBranch("PHOS");
+ if (!branch) {
+ AliError("can't get the branch with the PHOS digits !");
+ return;
+ }
+ TClonesArray *fDigitsArr = new TClonesArray("AliPHOSDigit",100);
+ branch->SetAddress(&fDigitsArr);
+ branch->GetEntry(0);
+
+ // Get the clusters array
+ TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+ if (!emcbranch) {
+ AliError("can't get the branch with the PHOS EMC clusters !");
+ return;
+ }
+
+ TObjArray *fEmcRecPoints = new TObjArray(100) ;
+ emcbranch->SetAddress(&fEmcRecPoints);
+ emcbranch->GetEntry(0);
+
//Fill CaloClusters
const Float_t kBigShort = std::numeric_limits<short int>::max() - 1;
const Float_t nsec100 = 1e9*100.; // units of 0.01 ns
// Get track segment and EMC rec.point associated with this rec.particle
AliPHOSTrackSegment *ts = static_cast<AliPHOSTrackSegment *>(tsm->GetTrackSegments()->At(rp->GetPHOSTSIndex()));
- // Get the clusters array
- TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
- if (!emcbranch) {
- AliError("can't get the branch with the PHOS EMC clusters !");
- return;
- }
- TObjArray *emcRecPoints = new TObjArray(100) ;
- emcbranch->SetAddress(&emcRecPoints);
- emcbranch->GetEntry(0);
-
- AliPHOSEmcRecPoint *emcRP = static_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(ts->GetEmcIndex()));
+ AliPHOSEmcRecPoint *emcRP = static_cast<AliPHOSEmcRecPoint *>(fEmcRecPoints->At(ts->GetEmcIndex()));
AliESDCaloCluster *ec = new AliESDCaloCluster() ;
-
+
Float_t xyz[3];
for (Int_t ixyz=0; ixyz<3; ixyz++)
xyz[ixyz] = rp->GetPos()[ixyz];
Short_t *timeList = new Short_t[digitMult];
Short_t *digiList = new Short_t[digitMult];
- // Read digits array
- TBranch *branch = digitsTree->GetBranch("PHOS");
- if (!branch) {
- AliError("can't get the branch with the PHOS digits !");
- return;
- }
- TClonesArray *digitsArr = new TClonesArray("AliPHOSDigit",100);
- branch->SetAddress(&digitsArr);
- branch->GetEntry(0);
-
// Convert Float_t* and Int_t* to Short_t* to save memory
for (Int_t iDigit=0; iDigit<digitMult; iDigit++) {
- AliPHOSDigit *digit = static_cast<AliPHOSDigit *>(digitsArr->At(digitsList[iDigit]));
+ AliPHOSDigit *digit = static_cast<AliPHOSDigit *>(fDigitsArr->At(digitsList[iDigit]));
amplList[iDigit] =
(Short_t)(TMath::Min(digit->GetEnergy()*gev500,kBigShort)); // Energy in units of GeV/500
timeList[iDigit] =
// fills the ESDCaloCluster
ec->SetPHOS(kTRUE);
- ec->SetPosition(xyz); //rec.point position in MARS
- ec->SetE(rp->Energy()); //total particle energy
+ ec->SetPosition(xyz); //rec.point position in MARS
+ ec->SetE(rp->Energy()); //total particle energy
ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion
- ec->SetPid (rp->GetPID()) ; //array of particle identification
+ ec->SetPid(rp->GetPID()) ; //array of particle identification
ec->SetM02(emcRP->GetM2x()) ; //second moment M2x
ec->SetM20(emcRP->GetM2z()) ; //second moment M2z
ec->SetNExMax(emcRP->GetNExMax()); //number of local maxima
delete [] amplList;
delete [] timeList;
delete [] digiList;
- }
+ }
+
+ delete tsm;
+ delete pid;
}
+//____________________________________________________________________________
AliTracker* AliPHOSReconstructor::CreateTracker() const
{
// creates the PHOS tracker
modMax,colMax,rowMax,eMax));
digitsTree->Fill();
+ digits->Delete();
+ delete digits;
}
/* History of cvs commits:
*
* $Log$
+ * Revision 1.14 2007/09/26 14:22:18 cvetan
+ * Important changes to the reconstructor classes. Complete elimination of the run-loaders, which are now steered only from AliReconstruction. Removal of the corresponding Reconstruct() and FillESD() methods.
+ *
* Revision 1.13 2007/08/30 10:40:27 cvetan
* Minor
*
//_________________________________________________________________________
// Wrapping class for reconstruction
-//*--
-//*-- Author: Yves Schutz (SUBATECH)
+//--
+//-- Author: Yves Schutz (SUBATECH)
// Reconstruction class. Redesigned from the old AliReconstructionner class and
// derived from STEER/AliReconstructor.
//_________________________________________________________________________
// requested by the Coding Convention
Fatal("cpy ctor", "not implemented") ;
}
- ~AliPHOSReconstructor() ; //dtor
+ virtual ~AliPHOSReconstructor() ; //dtor
+
static void SetDebug() { fgDebug = kTRUE ; }
static void ResetDebug() { fgDebug = kFALSE ; }
static Bool_t Debug() { return fgDebug ; }
private:
static Bool_t fgDebug ; //! verbosity controller
- static AliPHOSRecoParam* fgkRecoParamEmc; // reconstruction parameters for EMC
- static AliPHOSRecoParam* fgkRecoParamCpv; // reconstruction parameters for EMC
- AliPHOSGeometry* fGeom; // pointer to the PHOS geometry
+ static AliPHOSRecoParam *fgkRecoParamEmc; // reconstruction parameters for EMC
+ static AliPHOSRecoParam *fgkRecoParamCpv; // reconstruction parameters for EMC
+ AliPHOSGeometry *fGeom; // pointer to the PHOS geometry
ClassDef(AliPHOSReconstructor,4) // PHOS Reconstruction class