-A first method to calculate the distance from a cluster to closest bad channel implemented.
Output kept in AliESDCaloClusters::GetDistanceToBadChannel
-Ideal map (no dead channels) committed to OCDB/EMCAL/Calib/Pedestals
Example macro to create a bad channel map to be put in OCDB is in EMCAL/macros/PedestalDB
// Parameter/cut handling
//_____________________________________________________________________
void AliCaloCalibPedestal::SetParametersFromFile(const char *parameterFile)
-{
+{
+ // Note: this method is a bit more complicated than it really has to be
+ // - allowing for multiple entries per line, arbitrary order of the
+ // different variables etc. But I wanted to try and do this in as
+ // correct a C++ way as I could (as an exercise).
+
static const string delimitor("::");
// open, check input file
return;
}
- // Note: this method is a bit more complicated than it really has to be
- // - allowing for multiple entries per line, arbitrary order of the
- // different variables etc. But I wanted to try and do this in as
- // correct a C++ way as I could (as an exercise).
// read in
char readline[1024];
//_____________________________________________________________________
void AliCaloCalibPedestal::WriteParametersToFile(const char *parameterFile)
{
+ //Write parameters in file.
+
static const string delimitor("::");
ofstream out( parameterFile );
out << "// " << parameterFile << endl;
fResurrectedTowers = countRes;
}
+//_____________________________________________________________________
+Bool_t AliCaloCalibPedestal::IsBadChannel(int imod, int icol, int irow) const
+{
+ //Check if channel is dead or hot.
+
+ Int_t status = ((TH2D*)fDeadMap[imod])->GetBinContent(icol,irow);
+ if(status == kAlive)
+ return kFALSE;
+ else
+ return kTRUE;
+
+}
+
+//_____________________________________________________________________
+void AliCaloCalibPedestal::SetChannelStatus(int imod, int icol, int irow, int status)
+{
+ //Set status of channel dead, hot, alive ...
+
+ ((TH2D*)fDeadMap[imod])->SetBinContent(icol,irow, status);
+
+}
public:
enum kDetType {kPhos, kEmCal, kNone};//The detector types
- enum kDeadMapEntry{kAlive = 0, kDead, kResurrected, kRecentlyDeceased, kNumDeadMapStates};//The entries being put to the deadmap
+ enum kDeadMapEntry{kAlive = 0, kDead, kHot, kResurrected, kRecentlyDeceased, kNumDeadMapStates};//The entries being put to the deadmap
AliCaloCalibPedestal(kDetType detectorType = kPhos);
virtual ~AliCaloCalibPedestal();
TProfile2D * GetPeakProfileLowGainRatio(int i){ValidateComparisonProfiles(); return (TProfile2D*)fPeakMinusPedLowGainRatio[i];}; // Return a pointer to the low-gain peak-pedestal profile ratio
TProfile2D * GetPeakProfileHighGainRatio(int i){ValidateComparisonProfiles(); return (TProfile2D*)fPeakMinusPedHighGainRatio[i];}; // Return a pointer to the high-gain peak-pedestal profile ratio
- TH2D * GetDeadMap(int i) const {return (TH2D*)fDeadMap[i];};
-
+ TH2D * GetDeadMap(int i) const {return (TH2D*)fDeadMap[i];}
+ //void SetDeadMap(int i, TH2D *h) const {((TH2D*)fDeadMap[i])=h;}
+
+ Bool_t IsBadChannel(int imod, int icol, int irow) const;
+ void SetChannelStatus(int imod, int icol, int irow, int status);
+
+ TObjArray GetDeadMap() const {return fDeadMap;}
+ void SetDeadMap(TObjArray map) {fDeadMap = map;}
+
// Basic info: getters
kDetType GetDetectorType() const {return fDetType;};//Returns if this is a PHOS or EMCAL object
TString GetCaloString() const {return fCaloString;}; //Returns if this is a PHOS or EMCAL object
/////////////////////////////
//Analysis functions
+ void SetDeadTowerCount(Int_t dead) {fDeadTowers = dead;};//Returns the number of dead towers, by counting the bins in peak-pedestal smaller than threshold
int GetDeadTowerCount() const {return fDeadTowers;};//Returns the number of dead towers, by counting the bins in peak-pedestal smaller than threshold
double GetDeadTowerRatio() const {return fDeadTowers/(double)(fRows*fColumns);}; //returns the percentage of dead towers, relative to a full module
int GetDeadTowerNew() const {return fNewDeadTowers;}; //return the new dead towers compared to the reference
int fNChanFills; //# total channel fills (NChan * NEvents if not zero-suppressed)
//The dead tower counts
- int fDeadTowers; //!
+ int fDeadTowers; // Number of towers found dead.
int fNewDeadTowers; //! Towers that have died since the reference run
int fResurrectedTowers; //! Towers that have been resurrected from the dead, compared to the reference
static const int fgkPhosCols = 56; // number of columns per module for PHOS
static const int fgkPhosModules = 5; // number of modules for PHOS
- ClassDef(AliCaloCalibPedestal, 5)
+ ClassDef(AliCaloCalibPedestal, 6)
};
#include "AliEMCALRecParam.h"
#include "AliEMCALReconstructor.h"
#include "AliCDBManager.h"
+#include "AliCaloCalibPedestal.h"
class AliCDBStorage;
#include "AliCDBEntry.h"
fGeom(0),
fDefaultInit(kFALSE),
fToUnfold(kFALSE),
- fNumberOfECAClusters(0),fCalibData(0),
+ fNumberOfECAClusters(0),fCalibData(0),fCaloPed(0),
fADCchannelECA(0.),fADCpedestalECA(0.),fECAClusteringThreshold(0.),fECALocMaxCut(0.),
fECAW0(0.),fTimeCut(0.),fMinECut(0.)
{
fGeom(geometry),
fDefaultInit(kFALSE),
fToUnfold(kFALSE),
- fNumberOfECAClusters(0),fCalibData(0),
+ fNumberOfECAClusters(0),fCalibData(0), fCaloPed(0),
fADCchannelECA(0.),fADCpedestalECA(0.),fECAClusteringThreshold(0.),fECALocMaxCut(0.),
fECAW0(0.),fTimeCut(0.),fMinECut(0.)
{
}
//____________________________________________________________________________
-AliEMCALClusterizerv1::AliEMCALClusterizerv1(AliEMCALGeometry* geometry, AliEMCALCalibData * calib)
+AliEMCALClusterizerv1::AliEMCALClusterizerv1(AliEMCALGeometry* geometry, AliEMCALCalibData * calib, AliCaloCalibPedestal * caloped)
: AliEMCALClusterizer(),
fGeom(geometry),
fDefaultInit(kFALSE),
fToUnfold(kFALSE),
-fNumberOfECAClusters(0),fCalibData(calib),
+fNumberOfECAClusters(0),fCalibData(calib), fCaloPed(caloped),
fADCchannelECA(0.),fADCpedestalECA(0.),fECAClusteringThreshold(0.),fECALocMaxCut(0.),
fECAW0(0.),fTimeCut(0.),fMinECut(0.)
{
}
fGeom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
-
+
+ // Check if channel is bad (dead, hot ...), in this case return 0.
+ if(fCaloPed->IsBadChannel(iSupMod,ieta,iphi)) {
+ AliDebug(2,Form("Tower from SM %d, ieta %d, iphi %d is BAD!!!\n",iSupMod,ieta,iphi));
+ return 0;
+ }
+
fADCchannelECA = fCalibData->GetADCchannel (iSupMod,ieta,iphi);
fADCpedestalECA = fCalibData->GetADCpedestal(iSupMod,ieta,iphi);
//Get calibration parameters from file or digitizer default values.
GetCalibrationParameters() ;
-
+ //Get dead channel map from file or digitizer default values.
+ GetCaloCalibPedestal() ;
+
fNumberOfECAClusters = 0;
MakeClusters() ; //only the real clusters
//Evaluate position, dispersion and other RecPoint properties for EC section
for(index = 0; index < fRecPoints->GetEntries(); index++) {
dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(index))->EvalAll(fECAW0,fDigitsArr) ;
+ //For each rec.point set the distance to the nearest bad crystal
+ dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(index))->EvalDistanceToBadChannels(fCaloPed);
}
fRecPoints->Sort() ;
}
+//____________________________________________________________________________
+void AliEMCALClusterizerv1::GetCaloCalibPedestal()
+{
+ // Set calibration parameters:
+ // if calibration database exists, they are read from database,
+ // otherwise, they are taken from digitizer.
+ //
+ // It is a user responsilibity to open CDB before reconstruction,
+ // for example:
+ // AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB");
+
+ //Check if calibration is stored in data base
+
+ if(!fCaloPed)
+ {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
+ if (entry) fCaloPed = (AliCaloCalibPedestal*) entry->GetObject();
+ }
+
+ if(!fCaloPed)
+ AliFatal("Pedestal info not found in CDB!");
+
+}
+
+
//____________________________________________________________________________
void AliEMCALClusterizerv1::Init()
{
fTimeCut = 300e-9 ; // 300 ns time cut (to be tuned)
fCalibData = 0 ;
-
+ fCaloPed = 0 ;
+
const AliEMCALRecParam* recParam = AliEMCALReconstructor::GetRecParam();
if(!recParam) {
AliFatal("Reconstruction parameters for EMCAL not set!");
class AliEMCALDigitizer ;
class AliEMCALGeometry ;
class AliEMCALCalibData ;
+class AliCaloCalibPedestal ;
class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
AliEMCALClusterizerv1() ;
AliEMCALClusterizerv1(AliEMCALGeometry* geometry);
- AliEMCALClusterizerv1(AliEMCALGeometry* geometry, AliEMCALCalibData * calib);
+ AliEMCALClusterizerv1(AliEMCALGeometry* geometry, AliEMCALCalibData * calib, AliCaloCalibPedestal * pedestal);
virtual ~AliEMCALClusterizerv1() ;
virtual const char * Version() const { return "clu-v1" ; }
void PrintRecoInfo(); //*MENU*
- void SetCalibrationParameters(AliEMCALCalibData * calib) { fCalibData = calib ; }
-
+ void SetCalibrationParameters(AliEMCALCalibData * calib) { fCalibData = calib ; }
+ void SetCaloCalibPedestal(AliCaloCalibPedestal * caloped) { fCaloPed = caloped ; }
+
protected:
virtual void MakeClusters();
AliEMCALClusterizerv1 & operator = (const AliEMCALClusterizerv1 &);
void GetCalibrationParameters(void) ;
-
+ void GetCaloCalibPedestal(void) ;
+
Bool_t FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, const Float_t * maxAtEnergy,
Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
void Init() ;
//Calibration parameters... to be replaced by database
- AliEMCALCalibData * fCalibData ; //! Calibration database if aval
+ AliEMCALCalibData * fCalibData ; //! Calibration database if aval
+ AliCaloCalibPedestal * fCaloPed ; //! Tower status map if aval
+
Float_t fADCchannelECA ; // width of one ADC channel for EC section (GeV)
Float_t fADCpedestalECA ; // pedestal of ADC for EC section (GeV)
Float_t fTimeCut ; // Maximum time difference between the digits in ont EMC cluster
Float_t fMinECut; // Minimum energy for a digit to be a member of a cluster
- ClassDef(AliEMCALClusterizerv1,7) // Clusterizer implementation version 1
+ ClassDef(AliEMCALClusterizerv1,8) // Clusterizer implementation version 1
};
ClassImp(AliEMCALLoader)
const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
-AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibation data
+AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibation data
+AliCaloCalibPedestal* AliEMCALLoader::fgCaloPed = 0; //dead map data
//____________________________________________________________________________
AliEMCALLoader::AliEMCALLoader()
}
+//____________________________________________________________________________
+AliCaloCalibPedestal* AliEMCALLoader::PedestalData()
+{
+ // Check if the instance of AliCaloCalibPedestal exists, if not, create it if
+ // the OCDB is available, and finally return it.
+
+ if(!fgCaloPed && (AliCDBManager::Instance()->IsDefaultStorageSet()))
+ {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
+ if (entry) fgCaloPed = (AliCaloCalibPedestal*) entry->GetObject();
+ }
+
+ if(!fgCaloPed)
+ AliFatal("Pedestal info not found in CDB!");
+
+ return fgCaloPed;
+
+}
+
//____________________________________________________________________________
Int_t AliEMCALLoader::CalibrateRaw(Double_t energy, Int_t module,
// --- AliRoot header files ---
#include "AliLoader.h"
#include "AliEMCALCalibData.h"
+#include "AliCaloCalibPedestal.h"
class AliLoader ;
class AliEMCAL ;
// ************ TClonesArrays Access functions
- TClonesArray* Hits(void) { return fHits;}
+ TClonesArray* Hits(void) const { return fHits;}
const AliEMCALHit* Hit(Int_t index) {
if (fHits)
return 0x0;
}
- TClonesArray* SDigits() { return fSDigits;}
+ TClonesArray* SDigits() const { return fSDigits;}
const AliEMCALDigit* SDigit(Int_t index) {
if (fSDigits)
return (const AliEMCALDigit*) fSDigits->At(index);
return 0x0;
}
- TClonesArray* Digits() { return fDigits;}
+ TClonesArray* Digits() const { return fDigits;}
const AliEMCALDigit * Digit(Int_t index) {
if (fDigits)
return (const AliEMCALDigit*) fDigits->At(index);
return 0x0;
}
- TObjArray * RecPoints() { return fRecPoints;}
+ TObjArray * RecPoints() const { return fRecPoints;}
const AliEMCALRecPoint * RecPoint(Int_t index) {
if (fRecPoints)
return (const AliEMCALRecPoint*) fRecPoints->At(index);
void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
AliEMCALCalibData * CalibData(); // to get the calibration CDB object
+ void SetPedestalData(AliCaloCalibPedestal* caloped) { fgCaloPed = caloped; }
+ AliCaloCalibPedestal* PedestalData(); // to get the pedestal CDB object
+
+
private:
// assignement operator requested by coding convention, but not needed
TClonesArray *fSDigits; //! TClonesArray of sdigits (for tree reading)
TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
- static AliEMCALCalibData * fgCalibData; // calibration data
+ static AliEMCALCalibData * fgCalibData; // calibration data
+ static AliCaloCalibPedestal * fgCaloPed; // dead map
- ClassDef(AliEMCALLoader,2) // Algorithm class that provides methods to retrieve objects from a list knowing the index
+ ClassDef(AliEMCALLoader,3) // Algorithm class that provides methods to retrieve objects from a list knowing the index
};
//_________________________________________________________________________
// Reconstructed Points for the EMCAL
// A RecPoint is a cluster of digits
+//
+//
//*-- Author: Yves Schutz (SUBATECH)
//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
//*-- Author: Heather Gray (LBL) merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
#include "AliEMCALHit.h"
#include "AliEMCALDigit.h"
#include "AliEMCALRecPoint.h"
+#include "AliCaloCalibPedestal.h"
+#include "AliEMCALGeoParams.h"
ClassImp(AliEMCALRecPoint)
fTime(0.), fNExMax(0), fCoreRadius(10), //HG check this
fDETracksList(0), fMulParent(0), fMaxParent(0),
fParentsList(0), fDEParentsList(0), fSuperModuleNumber(0),
- fDigitIndMax(-1)
+ fDigitIndMax(-1), fDistToBadTower(-1)
{
// ctor
fGeomPtr = AliEMCALGeometry::GetInstance();
fAbsIdList(new Int_t[fMaxDigit]), fTime(-1.), fNExMax(0), fCoreRadius(10),
fDETracksList(new Float_t[fMaxTrack]), fMulParent(0), fMaxParent(1000),
fParentsList(new Int_t[fMaxParent]), fDEParentsList(new Float_t[fMaxParent]),
- fSuperModuleNumber(0), fDigitIndMax(-1)
+ fSuperModuleNumber(0), fDigitIndMax(-1), fDistToBadTower(-1)
{
// ctor
for (Int_t i = 0; i < fMaxTrack; i++)
fDETracksList(new Float_t[rp.fMaxTrack]), fMulParent(rp.fMulParent),
fMaxParent(rp.fMaxParent), fParentsList(new Int_t[rp.fMaxParent]),
fDEParentsList(new Float_t[rp.fMaxParent]),
- fSuperModuleNumber(rp.fSuperModuleNumber), fDigitIndMax(rp.fDigitIndMax)
+ fSuperModuleNumber(rp.fSuperModuleNumber), fDigitIndMax(rp.fDigitIndMax),
+ fDistToBadTower(rp.fDistToBadTower)
{
//copy ctor
fLambda[0] = rp.fLambda[0];
fLambda[0] = rp.fLambda[0];
fLambda[1] = rp.fLambda[1];
-
+
+ fDistToBadTower = rp.fDistToBadTower;
+
return *this;
}
EvalTime(digits) ;
EvalPrimaries(digits) ;
EvalParents(digits);
-
+
//Called last because it sets the global position of the cluster?
EvalLocal2TrackingCSTransform();
fDispersion = TMath::Sqrt(d) ;
}
+//____________________________________________________________________________
+void AliEMCALRecPoint::EvalDistanceToBadChannels(AliCaloCalibPedestal* caloped)
+{
+ //For each EMC rec. point set the distance to the nearest bad channel.
+ //AliInfo(Form("%d bad channel(s) found.\n", caloped->GetDeadTowerCount()));
+ //Needs to be carefully checked!!! Gustavo 10-11-2009
+
+ if(!caloped->GetDeadTowerCount()) return;
+
+ //Number of supermodule this cluster belongs.
+ Int_t iSM = GetSuperModuleNumber();
+
+ //Get channels map of the supermodule where the cluster is
+ TH2D* hMap = caloped->GetDeadMap(iSM);
+
+ TVector3 dR;
+ TVector3 cellpos;
+
+ Int_t minDist = 100000;
+ Int_t dist = 0;
+ Int_t absId = -1;
+
+ //Loop on tower status map
+ for(Int_t irow = 0; irow < AliEMCALGeoParams::fgkEMCALRows; irow++){
+ for(Int_t icol = 0; icol < AliEMCALGeoParams::fgkEMCALCols; icol++){
+ //Check if tower is bad.
+ if(hMap->GetBinContent(icol,irow)==AliCaloCalibPedestal::kAlive) continue;
+ //printf("AliEMCALRecPoint::EvalDistanceToBadChannels() - Bad channel in SM %d, col %d, row %d\n",iSM,icol, irow);
+ //Tower is bad, get the absId of the index.
+ absId = fGeomPtr->GetAbsCellIdFromCellIndexes(iSM, irow, icol);
+ //Get the position of this tower.
+ fGeomPtr->RelPosCellInSModule(absId,cellpos);
+ //Calculate distance between this tower and cluster, set if is smaller than previous.
+ dR = cellpos-fLocPos;
+ dist = dR.Mag();
+ if(dist<minDist) minDist = dist;
+ }
+ }
+ fDistToBadTower = minDist;
+ //printf("AliEMCALRecPoint::EvalDistanceToBadChannel() - Distance to Bad is %f \n",fDistToBadTower);
+}
+
+
//____________________________________________________________________________
void AliEMCALRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
{
//_____________________________________________________________________________
Bool_t AliEMCALRecPoint::EvalLocalPositionFromDigits(const Double_t esum, const Double_t deff, const Double_t w0, TClonesArray *digits, TArrayD &ed, TVector3 &locPos)
{
+ //Evaluate position of digits in supermodule.
static AliEMCALDigit *digit;
Int_t i=0, nstat=0, idMax=-1;
* See cxx source for full Copyright notice */
//_________________________________________________________________________
// Base Class for EMCAL Reconstructed Points
-// A recpoint being equivalent to a cluster in encal terminology
+// A recpoint being equivalent to a cluster in EMCAL terminology
+//
+//
//*-- Author: Yves Schutz (SUBATECH)
//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
//*-- Author: Heather Gray (LBL): merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
class TPaveText;
class TGraph;
class Riostream;
-
// --- Standard library ---
// --- AliRoot header files ---
class AliEMCALDigit;
class AliDigitNew;
class AliEMCALGeometry;
-class AliEMCALHit;
+class AliEMCALHit;
+class AliCaloCalibPedestal;
class AliEMCALRecPoint : public AliCluster {
Int_t GetAbsIdMaxDigit() const {return GetAbsId(fDigitIndMax);}
Int_t GetIndMaxDigit() const {return fDigitIndMax;}
void SetIndMaxDigit(const Int_t ind) {fDigitIndMax = ind;}
- void SetIndexInList(Int_t val) { fIndexInList = val ; }
+ void SetIndexInList(Int_t val) { fIndexInList = val ; }
virtual Int_t GetSuperModuleNumber(void) const { return fSuperModuleNumber;}
static Double_t TmaxInCm(const Double_t e=0.0, const Int_t key=0);
+ Float_t GetDistanceToBadTower() const {return fDistToBadTower;}
+ void EvalDistanceToBadChannels(AliCaloCalibPedestal* caloped);
+
protected:
- void EvalCoreEnergy(Float_t logWeight,TClonesArray * digits) ;
+ void EvalCoreEnergy(Float_t logWeight,TClonesArray * digits) ;
virtual void EvalDispersion(Float_t logWeight,TClonesArray * digits) ; // computes the dispersion of the shower
virtual void EvalElipsAxis(Float_t logWeight, TClonesArray * digits ); // computes the axis of shower ellipsoide
- void EvalTime( TClonesArray * digits );
+ void EvalTime( TClonesArray * digits );
virtual Bool_t AreNeighbours(AliEMCALDigit * digit1, AliEMCALDigit * digit2 ) const;
Float_t ThetaToEta(Float_t arg) const; //Converts Theta (Radians) to Eta(Radians)
Float_t EtaToTheta(Float_t arg) const; //Converts Eta (Radians) to Theta(Radians)
private:
//JLK do we need this?
- AliEMCALGeometry* fGeomPtr; //! Pointer to geometry for utilities
-
- Float_t fAmp ; // summed amplitude of digits
- Int_t fIndexInList ; // the index of this RecPoint in the
- // list stored in TreeR (to be set by analysis)
- TVector3 fLocPos ; // local position in the sub-detector coordinate
- TMatrixF * fLocPosM ; // covariance matrix ;
- Int_t fMaxDigit ; //! max initial size of digits array (not saved)
- Int_t fMulDigit ; // total multiplicity of digits
- Int_t fMaxTrack ; //! max initial size of tracks array (not saved)
- Int_t fMulTrack ; // total multiplicity of tracks
- Int_t * fDigitsList ; //[fMulDigit] list of digit's indexes from which the point was reconstructed
- Int_t * fTracksList ; //[fMulTrack] list of tracks to which the point was assigned
-
- Int_t fClusterType; // type of cluster stored: pseudocluster or v1
+ AliEMCALGeometry* fGeomPtr; //! Pointer to geometry for utilities
+
+ Float_t fAmp ; // summed amplitude of digits
+ Int_t fIndexInList ; // the index of this RecPoint in the
+ // list stored in TreeR (to be set by analysis)
+ TVector3 fLocPos ; // local position in the sub-detector coordinate
+ TMatrixF * fLocPosM ; // covariance matrix ;
+ Int_t fMaxDigit ; //! max initial size of digits array (not saved)
+ Int_t fMulDigit ; // total multiplicity of digits
+ Int_t fMaxTrack ; //! max initial size of tracks array (not saved)
+ Int_t fMulTrack ; // total multiplicity of tracks
+ Int_t * fDigitsList ; //[fMulDigit] list of digit's indexes from which the point was reconstructed
+ Int_t * fTracksList ; //[fMulTrack] list of tracks to which the point was assigned
+
+ Int_t fClusterType; // type of cluster stored: pseudocluster or v1
Float_t fCoreEnergy ; // energy in a shower core
Float_t fLambda[2] ; // shower ellipse axes
Float_t fDispersion ; // shower dispersion
Float_t *fEnergyList ; //[fMulDigit] energy of digits
Float_t *fTimeList ; //[fMulDigit] time of digits
- Int_t *fAbsIdList; //[fMulDigit] absId of digits
+ Int_t *fAbsIdList; //[fMulDigit] absId of digits
Float_t fTime ; // Time of the digit with maximal energy deposition
Short_t fNExMax ; // number of (Ex-)maxima before unfolding
Float_t fCoreRadius; // The radius in which the core energy is evaluated
Float_t *fDETracksList ; //[fMulTrack] list of tracks to which the point was assigned
Int_t fMulParent; // Multiplicity of the parents
- Int_t fMaxParent; // Maximum number of parents allowed
- Int_t * fParentsList; // [fMulParent] list of the parents of the digits
- Float_t * fDEParentsList; // [fMulParent] list of the parents of the digits
- Int_t fSuperModuleNumber; // number identifying supermodule containing recpoint
- // Aug 16, 2007
- Int_t fDigitIndMax; // Index of digit with max energy in array fAbsIdList
-
- ClassDef(AliEMCALRecPoint,11) // RecPoint for EMCAL (Base Class)
+ Int_t fMaxParent; // Maximum number of parents allowed
+ Int_t * fParentsList; // [fMulParent] list of the parents of the digits
+ Float_t * fDEParentsList; // [fMulParent] list of the parents of the digits
+ Int_t fSuperModuleNumber; // number identifying supermodule containing recpoint
+ // Aug 16, 2007
+ Int_t fDigitIndMax; // Index of digit with max energy in array fAbsIdList
+ Float_t fDistToBadTower; // Distance to nearest bad tower
+
+ ClassDef(AliEMCALRecPoint,12) // RecPoint for EMCAL (Base Class)
};
TClonesArray* AliEMCALReconstructor::fgDigitsArr = 0; // shoud read just once at event
//____________________________________________________________________________
AliEMCALReconstructor::AliEMCALReconstructor()
- : fDebug(kFALSE), fList(0), fGeom(0),fCalibData(0)
+ : fDebug(kFALSE), fList(0), fGeom(0),fCalibData(0),fPedestalData(0)
{
// ctor
if(!fCalibData)
AliFatal("Calibration parameters not found in CDB!");
+ //Get calibration parameters
+ if(!fPedestalData)
+ {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
+ if (entry) fPedestalData = (AliCaloCalibPedestal*) entry->GetObject();
+ }
+
+ if(!fPedestalData)
+ AliFatal("Dead map not found in CDB!");
+
+
//Init the clusterizer with geometry and calibration pointers, avoid doing it twice.
- fgClusterizer = new AliEMCALClusterizerv1(fGeom, fCalibData);
+ fgClusterizer = new AliEMCALClusterizerv1(fGeom, fCalibData,fPedestalData);
if(!fGeom) AliFatal(Form("Could not get geometry!"));
const AliEMCALDigit * dig = (const AliEMCALDigit*)digits->At(idig);
if(dig->GetAmp() > 0 ){
energy = (static_cast<AliEMCALClusterizerv1*> (fgClusterizer))->Calibrate(dig->GetAmp(),dig->GetId());
- emcCells.SetCell(idignew,dig->GetId(),energy, dig->GetTime());
- idignew++;
+ if(energy > 0){ //Digits tagged as bad (dead, hot, not alive) are set to 0 in calibrate, remove them
+ emcCells.SetCell(idignew,dig->GetId(),energy, dig->GetTime());
+ idignew++;
+ }
}
}
emcCells.SetNumberOfCells(idignew);
ec->SetClusterType(AliESDCaloCluster::kEMCALClusterv1);
ec->SetPosition(xyz);
ec->SetE(clust->GetEnergy());
+
+ //Distance to the nearest bad crystal
+ ec->SetDistanceToBadChannel(clust->GetDistanceToBadTower());
+
ec->SetNCells(newCellMult);
//Change type of list from short to ushort
UShort_t *newAbsIdList = new UShort_t[newCellMult];
//*--
//*-- Author: Yves Schutz (SUBATECH)
//*-- Dmitri Peressounko (SUBATECH & Kurchatov Institute)
+// Reconstruction class. Redesigned from the old AliReconstructionner class and
+// derived from STEER/AliReconstructor.
+//
+//-- Aleksei Pavlinov : added staf for EMCAL jet trigger 9Apr 25, 2008)
+// : fgDigitsArr should read just once at event
+
// --- ROOT system ---
class TList;
class AliEMCALRawUtils;
class AliEMCALGeometry;
class AliEMCALCalibData ;
+class AliCaloCalibPedestal ;
// --- Standard library ---
void ReadDigitsArrayFromTree(TTree *digitsTree) const;
- TList *GetList() {return fList;}
+ TList *GetList() const {return fList;}
static const AliEMCALRecParam* GetRecParam() {
return dynamic_cast<const AliEMCALRecParam*>(AliReconstructor::GetRecoParam(6)); }
static AliEMCALRawUtils* fgRawUtils; // raw utilities class -
// only need one per reco
static TClonesArray* fgDigitsArr; // Array with EMCAL digits
- AliEMCALCalibData * fCalibData ; //! Calibration database if aval
+ AliEMCALCalibData * fCalibData ; //! Calibration database if aval
+ AliCaloCalibPedestal * fPedestalData ; //! Tower status database if aval
- ClassDef(AliEMCALReconstructor,7) // Reconstruction algorithm class (Base Class)
+ ClassDef(AliEMCALReconstructor,8) // Reconstruction algorithm class (Base Class)
};
--- /dev/null
+// Script to create dead channel map and store them into CDB
+// - 4 sets of maps parameters can be created, with now dead channels
+// and 5%, 10%, 20% and 30% of dead channels
+// - it reads the stored map in a given file.
+// Author: Gustavo Conesa
+
+//.x $ALICE_ROOT/EMCAL/macros/CalibrationDB/AliEMCALSetTowerStatusCDB.C
+
+#if !defined(__CINT__)
+#include <TControlBar.h>
+#include <TString.h>
+#include <TRandom.h>
+#include <TStyle.h>
+#include <TH2.h>
+#include <TF1.h>
+#include <TCanvas.h>
+
+#include "AliRun.h"
+#include "AliCaloCalibPedestal.h"
+#include "AliEMCALGeoParams.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBId.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#endif
+
+
+void AliEMCALPedestalCDB()
+{
+ TControlBar *menu = new TControlBar("vertical","EMCAL CDB");
+ menu->AddButton("Help to run EMCAL CDB","Help()",
+ "Explains how to use EMCAL CDS menus");
+ menu->AddButton("Equal Tower Status Map, all Alive","SetTowerStatusMap(0)",
+ "Set all channels to alive");
+ menu->AddButton("Create Random Status Map, 5% dead","SetTowerStatusMap(5)",
+ "Set randomly 5% of the channels dead");
+ menu->AddButton("Create Random Status Map, 10% dead","SetTowerStatusMap(10)",
+ "Set randomly 10% of the channels dead");
+ menu->AddButton("Create Random Status Map, 20% dead","SetTowerStatusMap(20)",
+ "Set randomly 20% of the channels dead");
+ menu->AddButton("Create Random Status Map, 30% dead","SetTowerStatusMap(30)",
+ "Set randomly 30% of the channels dead");
+ menu->AddButton("Read Tower Status Map","GetTowerStatusMap()",
+ "Read initial equal calibration coefficients");
+ menu->Show();
+}
+
+//------------------------------------------------------------------------
+void Help()
+{
+ char *string =
+ "\nSet tower status map (dead, hot, alive) and write them into ALICE CDB. Press button \"Equal kAlive\" to set all channels alive. Press button \"Random, 5% dead\" to create random dead channel map at 5%\n";
+ printf(string);
+}
+
+//------------------------------------------------------------------------
+void SetTowerStatusMap(Int_t percent=0)
+{
+ // Writing status of all the channels in the OCDB with equal value
+ // except a percent to be not alive. Right now only "alive" or "dead",
+ // we need to implement the other cases like "hot"
+
+ TString sDBFolder ="local://PedestalsDB";
+ Int_t firstRun = 0;
+ Int_t lastRun = 999999999;
+ Int_t beamPeriod = 1;
+ char* objFormat = Form("%d percent decalibrated channels", percent);
+
+ AliCaloCalibPedestal *caloped=new AliCaloCalibPedestal(AliCaloCalibPedestal::kEmCal);
+ TObjArray map = caloped->GetDeadMap();
+ printf("MAP entries %d\n",map.GetEntries());
+ TRandom rn;
+ //for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM ++){
+ for(Int_t iSM = 0; iSM < map.GetEntries(); iSM ++){
+ Int_t ndead = 0;
+ printf(" >>> SM %d <<< Entries %d, NbinsX %d, NbinsY %d\n",iSM,((TH2D*)map[iSM])->GetEntries(),((TH2D*)map[iSM])->GetNbinsX(),((TH2D*)map[iSM])->GetNbinsY());
+ for(Int_t i = 0; i < ((TH2D*)map[iSM])->GetNbinsX() ; i++){
+ for(Int_t j = 0; j < ((TH2D*)map[iSM])->GetNbinsY() ; j++){
+ //printf("Bin (%d-%d) Content, before: %d ",i,j,((TH2D*)map[iSM])->GetBinContent(i, j));
+
+ if(rn.Uniform(0,100) > percent)
+ ((TH2D*)map[iSM])->SetBinContent(i, j, AliCaloCalibPedestal::kAlive);
+ else{
+ ((TH2D*)map[iSM])->SetBinContent(i, j, AliCaloCalibPedestal::kDead);
+ ndead++;
+ }
+ //printf("; after: %d \n",((TH2D*)map[iSM])->GetBinContent(i, j));
+ }
+ }
+ caloped->SetDeadTowerCount(caloped->GetDeadTowerCount()+ndead);
+ printf("--- dead %d\n",ndead);
+ }
+
+ printf("--- total dead %d\n",caloped->GetDeadTowerCount());
+
+ caloped->SetDeadMap(map);
+
+ //Store map into database
+
+ AliCDBMetaData md;
+ md.SetComment(objFormat);
+ md.SetBeamPeriod(beamPeriod);
+ md.SetResponsible("Gustavo Conesa");
+
+ AliCDBId id("EMCAL/Calib/Pedestals",firstRun,lastRun); // create in EMCAL/Calib/Pedestal sDBFolder
+
+ AliCDBManager* man = AliCDBManager::Instance();
+ AliCDBStorage* loc = man->GetStorage(sDBFolder.Data());
+ loc->Put(caloped, id, &md);
+
+}
+
+//------------------------------------------------------------------------
+void GetTowerStatusMap()
+{
+ // Read status map
+
+ TString sDBFolder ="local://PedestalsDB";
+ Int_t runNumber = 0;
+
+ AliCaloCalibPedestal* caloped = (AliCaloCalibPedestal*)
+ (AliCDBManager::Instance()
+ ->GetStorage(sDBFolder.Data())
+ ->Get("EMCAL/Calib/Pedestals",
+ runNumber)->GetObject());
+
+ cout<<endl;
+ TObjArray map = caloped->GetDeadMap();
+ printf("MAP entries %d\n",map.GetEntries());
+ for(Int_t iSM = 0; iSM < map.GetEntries(); iSM ++){
+ TCanvas *cMap = new TCanvas(Form("cMap%d",iSM),Form("SM %d dead map",iSM), 12,12,400,400);
+ cMap->Divide(1,1);
+ Int_t ndead = 0;
+ printf(" >>> SM %d <<< Entries %d, NbinsX %d, NbinsY %d\n",iSM,((TH2D*)map[iSM])->GetEntries(),((TH2D*)map[iSM])->GetNbinsX(),((TH2D*)map[iSM])->GetNbinsY());
+ for(Int_t i = 0; i < ((TH2D*)map[iSM])->GetNbinsX() ; i++){
+ for(Int_t j = 0; j < ((TH2D*)map[iSM])->GetNbinsY() ; j++){
+ //printf("Bin (%d-%d) Content: %d \n",i,j,((TH2D*)map[iSM])->GetBinContent(i, j));
+
+ if(((TH2D*)map[iSM])->GetBinContent(i, j)==AliCaloCalibPedestal::kDead)
+ ndead++;
+ }
+ }
+ printf("--- dead %d\n",ndead);
+ cMap->cd(iSM);
+ (TH2D*)map[iSM])->Draw("lego2");
+ }
+
+ printf("Total DEAD %d\n", caloped->GetDeadTowerCount());
+
+}