// //
////////////////////////////////////////////////////////////////////////////
-#include "AliTRDPreprocessor.h"
-
#include <TFile.h>
#include <TProfile2D.h>
#include <TStopwatch.h>
#include "AliCDBMetaData.h"
#include "AliLog.h"
+#include "AliTRDPreprocessor.h"
#include "AliTRDSensorArray.h"
#include "AliTRDCalibraFit.h"
#include "AliTRDCalibraMode.h"
//______________________________________________________________________________________________
AliTRDPreprocessor::AliTRDPreprocessor(AliShuttleInterface *shuttle)
- :AliPreprocessor("TRD", shuttle),
- fVdriftHLT(0)
+ :AliPreprocessor("TRD", shuttle)
+ ,fVdriftHLT(0)
{
//
// Constructor
return 0;
}
-
-
if (runType=="PHYSICS"){
// DCS
if(ProcessDCS(dcsAliasMap)) return 1;
return 0;
}
+
//______________________________________________________________________________
Bool_t AliTRDPreprocessor::ProcessDCS()
{
+ //
+ // Default process DCS method
+ //
TString runType = GetRunType();
- if(runType == "PHYSICS") return kTRUE;
-
+ if (runType == "PHYSICS") {
+ return kTRUE;
+ }
return kFALSE;
}
//______________________________________________________________________________
-Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
+Bool_t AliTRDPreprocessor::ProcessDCS(TMap *dcsAliasMap)
{
- Bool_t error=kFALSE;
+ //
+ // Process DCS method
+ //
+
+ Bool_t error = kFALSE;
AliCDBMetaData metaData;
metaData.SetBeamPeriod(0);
metaData.SetResponsible("Wilfried Monange/Raphaelle Bailhache");
metaData.SetComment("TRD calib test");
-
-
- Log ("****** DCS ******\n");
+
+ Log("****** DCS ******\n");
TObjArray * list=AliTRDSensorArray::GetList ();
oneTRDDCS->SetStartTime (TTimeStamp (fStartTime));
oneTRDDCS->SetEndTime (TTimeStamp (fEndTime));
- Log (Form("Processing DCS : \"%s\"", oneTRDDCS->GetStoreName ().Data ()));
+ Log(Form("Processing DCS : \"%s\"", oneTRDDCS->GetStoreName ().Data ()));
TMap * map;
//results [iAlias] = StoreReferenceData("Calib", oneTRDDCS->GetStoreName ().Data (), oneTRDDCS, &metaData);
-
if (!results[iAlias]) {
AliError("Problem during StoreRef DCS");
error=kTRUE;
}
-
//BEGIN TEST (should not be removed ...)
/*
oneTRDDCS->ClearGraph();
*/
//END TEST
-
-
}
Log (" Summury of DCS :\n");
delete nGraph;
return error;
+
}
//______________________________________________________________________________________________
return kTRUE;
}
- // loop through all files from LDCs
-
+ // loop through all files from LDCs
UInt_t index = 0;
while (listpad->At(index)!=NULL) {
TObjString* fileNameEntry = (TObjString*) listpad->At(index);
} // fileNameEntry
++index;
}// while (list)
+
Log(Form("%d elements found in the list for the pedestal",(Int_t)index));
if(index==0){
delete listpad;
return kTRUE;
}
+
//
// Store pedestal entry to OCDB
//
-
-
+
// Create Pad Status
AliTRDCalPadStatus *calPadStatus = calPedSum.CreateCalPadStatus();
AliCDBMetaData md3;
return error;
}
+
//______________________________________________________________________________________________
Bool_t AliTRDPreprocessor::ExtractDriftVelocityDAQ()
{
md2.SetBeamPeriod(0);
md2.SetComment("TRD calib test");
-
-
-
// Take the file from the DAQ file exchange server
TList *listdaq = GetFileSources(kDAQ,"VDRIFT");
if (!listdaq) {
return error;
}
+
//______________________________________________________________________________________________
Bool_t AliTRDPreprocessor::ExtractHLT()
{
md2.SetResponsible("Raphaelle Bailhache");
md2.SetBeamPeriod(0);
md2.SetComment("TRD calib test");
-
// Take the file from the HLT file exchange server
TList *listhlt = GetFileSources(kHLT,"GAINDRIFTPRF");
// Take the file
TFile *filehlt = TFile::Open(fileName);
-
// gain
TH2I *histogain = (TH2I *) filehlt->Get("CH2d");
histogain->SetDirectory(0);
calibra->ResetVectorFit();
}// if histogain
-
-
// vdrift
fVdriftHLT = kFALSE;
TProfile2D *histodriftvelocity = (TProfile2D *) filehlt->Get("PH2d");
calibra->ResetVectorFit();
}// if TProfile2D
-
// prf
TProfile2D *histoprf = (TProfile2D *) filehlt->Get("PRF2d");
histoprf->SetDirectory(0);
class AliTRDPreprocessor : public AliPreprocessor
{
- public:
+ public:
- AliTRDPreprocessor(AliShuttleInterface *shuttle);
- virtual ~AliTRDPreprocessor();
+ AliTRDPreprocessor(AliShuttleInterface *shuttle);
+ virtual ~AliTRDPreprocessor();
protected:
- virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
- virtual UInt_t Process(TMap *dcsAliasMap);
+ virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+ virtual UInt_t Process(TMap *dcsAliasMap);
- Bool_t ExtractPedestals();
- Bool_t ExtractDriftVelocityDAQ();
- Bool_t ExtractHLT();
- Bool_t ProcessDCS();
- Bool_t ProcessDCS(TMap *dcsAliasMap);
+ Bool_t ExtractPedestals();
+ Bool_t ExtractDriftVelocityDAQ();
+ Bool_t ExtractHLT();
+ Bool_t ProcessDCS();
+ Bool_t ProcessDCS(TMap *dcsAliasMap);
- private:
+ private:
- Bool_t fVdriftHLT; // HLT Vdrift
+ Bool_t fVdriftHLT; // HLT Vdrift
- ClassDef(AliTRDPreprocessor,1) // The SHUTTLE preprocessor for TRD
+ ClassDef(AliTRDPreprocessor,1) // The SHUTTLE preprocessor for TRD
};
-
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
- Checks the quality assurance.
- By comparing with reference data
- S.Radomski Uni-Heidelberg October 2007
-*/
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+// //
+// Checks the quality assurance by comparing with reference data //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
#include <TClass.h>
#include "AliLog.h"
#include "AliQA.h"
#include "AliQAChecker.h"
+
#include "AliTRDQAChecker.h"
ClassImp(AliTRDQAChecker)
//__________________________________________________________________
AliTRDQAChecker& AliTRDQAChecker::operator = (const AliTRDQAChecker& qac )
{
+ //
// Equal operator.
+ //
+
this->~AliTRDQAChecker();
new(this) AliTRDQAChecker(qac);
return *this;
+
}
-#ifndef ALITRDQUALASSCHECKER_H
-#define ALITRDQUALASSCHECKER_H
+#ifndef ALITRDQACHECKER_H
+#define ALITRDQACHECKER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/*
- Checks the quality assurance.
- By comparing with reference data
- S. Radomski Uni-Heidelberg October 2007
-*/
+/* $Id$ */
+////////////////////////////////////////////////////////////////////////////
+// //
+// Checks the quality assurance by comparing with reference data //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
class TFile ;
// --- AliRoot header files ---
#include "AliQACheckerBase.h"
+
class AliTRDLoader ;
class AliTRDQAChecker: public AliQACheckerBase {
-public:
- AliTRDQAChecker() : AliQACheckerBase("TRD","TRD Quality Assurance Data Maker") {;} // ctor
- AliTRDQAChecker(const AliTRDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor
+ public:
+
+ AliTRDQAChecker() : AliQACheckerBase("TRD","TRD Quality Assurance Data Maker") {;}
+ AliTRDQAChecker(const AliTRDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;}
AliTRDQAChecker& operator = (const AliTRDQAChecker& qac) ;
- virtual ~AliTRDQAChecker() {;} // dtor
+ virtual ~AliTRDQAChecker() {;}
private:
- ClassDef(AliTRDQAChecker,1) // description
+ ClassDef(AliTRDQAChecker,1) // TRD QA checker
};
-
-#endif // AliTRDQAChecker_H
+#endif
////////////////////////////////////////////////////////////////////////////
// //
-// Produces the data needed to calculate the quality assurance. //
-// All data must be mergeable objects. //
-// S.Radomski Uni-Heidelberg October 2007 //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
// //
////////////////////////////////////////////////////////////////////////////
ClassImp(AliTRDQADataMaker)
//____________________________________________________________________________
- AliTRDQADataMaker::AliTRDQADataMaker() :
- AliQADataMaker(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+AliTRDQADataMaker::AliTRDQADataMaker()
+ :AliQADataMaker(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
{
- // ctor
+ //
+ // Default constructor
+ //
+
}
//____________________________________________________________________________
-AliTRDQADataMaker::AliTRDQADataMaker(const AliTRDQADataMaker& qadm) :
- AliQADataMaker()
+AliTRDQADataMaker::AliTRDQADataMaker(const AliTRDQADataMaker& qadm)
+ :AliQADataMaker()
{
- //copy ctor
+ //
+ // Copy constructor
+ //
+
SetName((const char*)qadm.GetName()) ;
SetTitle((const char*)qadm.GetTitle());
+
}
//__________________________________________________________________
AliTRDQADataMaker& AliTRDQADataMaker::operator = (const AliTRDQADataMaker& qadm )
{
+ //
// Equal operator.
+ //
+
this->~AliTRDQADataMaker();
new(this) AliTRDQADataMaker(qadm);
return *this;
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::EndOfDetectorCycle()
{
- //Detector specific actions at end of cycle
-
- // Rec points
+ //
+ // Detector specific actions at end of cycle
+ //
}
void AliTRDQADataMaker::InitESDs()
{
//
- // create ESDs histograms in ESDs subdir
+ // Create ESDs histograms in ESDs subdir
//
- const Int_t nhist = 21;
- TH1 *hist[nhist];
+ const Int_t kNhist = 21;
+ TH1 *hist[kNhist];
Int_t histoCounter = -1 ;
hist[++histoCounter] = new TH1D("qaTRD_esd_ntracks", ":Number of tracks", 300, -0.5, 299.5);
//hist[i]->Sumw2();
Add2ESDsList(hist[i], i);
}
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::InitHits()
{
- // create Hits histograms in Hits subdir
- const Int_t nhist = 4;
- TH1D *hist[nhist];
+ //
+ // Create Hits histograms in Hits subdir
+ //
+
+ const Int_t kNhist = 4;
+ TH1D *hist[kNhist];
hist[0] = new TH1D("qaTRD_hits_det", ";Detector Id of the hit", 540, -0.5, 539.5) ;
hist[2] = new TH1D("qaTRD_hist_Qamp", ";Charge from TRD photon", 100, 0, 100);
hist[3] = new TH1D("qaTRD_hist_Qphoton", ";Charge from TRD photon", 100, 0, 100);
- for(Int_t i=0; i<nhist; i++) {
+ for(Int_t i=0; i<kNhist; i++) {
//hist[i]->Sumw2();
Add2HitsList(hist[i], i);
}
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::InitDigits()
{
- // create Digits histograms in Digits subdir
-
- const Int_t nhist = 3;
- TH1D *hist[nhist];
+ //
+ // Create Digits histograms in Digits subdir
+ //
+
+ const Int_t kNhist = 3;
+ TH1D *hist[kNhist];
hist[0] = new TH1D("qaTRD_digits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
hist[1] = new TH1D("qaTRD_digits_time", ";Time bin", 40, -0.5, 39.5);
hist[2] = new TH1D("qaTRD_digits_amp", ";Amplitude", 100, 0, 100.);
- for(Int_t i=0; i<nhist; i++) {
+ for(Int_t i=0; i<kNhist; i++) {
hist[i]->Sumw2();
Add2DigitsList(hist[i], i);
}
//____________________________________________________________________________
void AliTRDQADataMaker::InitRecPoints()
{
- // create Reconstructed Points histograms in RecPoints subdir
- const Int_t nhist = 12;
- TH1 *hist[nhist];
+ //
+ // Create Reconstructed Points histograms in RecPoints subdir
+ //
+
+ const Int_t kNhist = 12;
+ TH1 *hist[kNhist];
hist[0] = new TH1D("qaTRD_recPoints_det", ";Detector ID of the cluster", 540, -0.5, 539.5);
hist[1] = new TH2D("qaTRD_recPoints_amp", ";Amplitude", 540, -0.5, 539, 200, -0.5, 199.5);
hist[12] = new TH1D("qaTRD_recPoints_ampDist", ";amplitude MPV", 100, 0, 100);
- for(Int_t i=0; i<nhist; i++) {
+ for(Int_t i=0; i<kNhist; i++) {
//hist[i]->Sumw2();
Add2RecPointsList(hist[i], i);
}
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::InitRaws()
{
- // create Raws histograms in Raws subdir
+ //
+ // Create Raws histograms in Raws subdir
+ //
+
const Int_t kSM = 18;
- const Int_t nhist = 6+kSM;
- TH1D *hist[nhist];
+ const Int_t kNhist = 6+kSM;
+ TH1D *hist[kNhist];
hist[0] = new TH1D("qaTRD_raws_det", ";detector", 540, -0.5, 539.5);
hist[1] = new TH1D("qaTRD_raws_sig", ";signal", 100, -0.5, 99.5);
hist[5] = new TH1D("qaTRD_rows_smId", ";supermodule", 18, -0.5, 17.5);
// one char per ADC chanell
- const Int_t nADC = 30 * 8 * 16 * 22;
+ const Int_t kNADC = 30 * 8 * 16 * 22;
for(Int_t i=0; i<kSM; i++)
- hist[6+i] = new TH1D(Form("qaTRD_raws_sm%d",i),"",nADC, -0.5, nADC-0.5);
+ hist[6+i] = new TH1D(Form("qaTRD_raws_sm%d",i),"",kNADC, -0.5, kNADC-0.5);
- for(Int_t i=0; i<nhist; i++) {
+ for(Int_t i=0; i<kNhist; i++) {
//hist[i]->Sumw2();
Add2RawsList(hist[i], i);
}
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::InitSDigits()
{
- // create SDigits histograms in SDigits subdir
-
- const Int_t nhist = 3;
- TH1D *hist[nhist];
+ //
+ // Create SDigits histograms in SDigits subdir
+ //
+
+ const Int_t kNhist = 3;
+ TH1D *hist[kNhist];
hist[0] = new TH1D("qaTRD_sdigits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
hist[1] = new TH1D("qaTRD_sdigits_time", ";Time bin", 40, -0.5, 39.5);
hist[2] = new TH1D("qaTRD_sdigits_amp", ";Amplitude", 100, 0, 1e7);
- for(Int_t i=0; i<nhist; i++) {
+ for(Int_t i=0; i<kNhist; i++) {
hist[i]->Sumw2();
Add2SDigitsList(hist[i], i);
}
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeESDs(AliESDEvent * esd)
{
- // make QA data from ESDs
+ //
+ // Make QA data from ESDs
+ //
+
Int_t nTracks = esd->GetNumberOfTracks();
GetESDsData(0)->Fill(nTracks);
}
-
-
}
//______________________________________________________________________________
-Int_t AliTRDQADataMaker::GetSector(const Double_t alpha) const {
+Int_t AliTRDQADataMaker::GetSector(const Double_t alpha) const
+{
+ //
// Gets the sector number
+ //
Double_t size = TMath::DegToRad() * 20.; // shall use TRDgeo
Int_t sector = (Int_t)((alpha + TMath::Pi())/size);
return sector;
+
}
//______________________________________________________________________________
-Double_t AliTRDQADataMaker::GetExtZ(const AliExternalTrackParam *in) const {
+Double_t AliTRDQADataMaker::GetExtZ(const AliExternalTrackParam *in) const
+{
//
- // returns the Z position at the entry to TRD
+ // Returns the Z position at the entry to TRD
// using parameters from the TPC in
//
- const Double_t x0 = 300;
+ const Double_t kX0 = 300;
Double_t x = in->GetX();
const Double_t *par = in->GetParameter();
Double_t theta = par[3];
Double_t z = in->GetZ();
- Double_t zz = z + (x0-x) * TMath::Tan(theta);
+ Double_t zz = z + (kX0-x) * TMath::Tan(theta);
return zz;
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeHits(TClonesArray * hits)
{
- //make QA data from Hits
- //printf("making QA for TRD hits from an array %d\n", hits->GetEntriesFast());
+ //
+ // Make QA data from Hits
+ //
TIter next(hits);
AliTRDhit * hit;
//____________________________________________________________________________
void AliTRDQADataMaker::MakeHits(TTree * hitTree)
{
- //make QA data from Hits
- //printf("making QA for TRD hits from a tree\n");
+ //
+ // Make QA data from Hits
+ //
if (!CheckPointer(hitTree, "TRD hits tree")) return;
tmp->Delete();
delete tmp;
MakeHits(hits);
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeDigits(TClonesArray * digits)
{
- // makes data from Digits
-
+ //
+ // Makes data from digits
+ //
+
TIter next(digits) ;
AliTRDdigit * digit ;
while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
GetDigitsData(0)->Fill(digit->GetDetector());
GetDigitsData(1)->Fill(digit->GetTime());
GetDigitsData(2)->Fill(digit->GetAmp());
- }
+ }
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeDigits(TTree * digits)
{
+ //
+ // Makes data from digits tree
+ //
AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
digitsManager->CreateArrays();
//delete digitsIn;
}
+
delete digitsManager;
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeSDigits(TClonesArray * sdigits)
{
- // makes data from Digits
-
+ //
+ // Makes data from digits
+ //
+
TIter next(sdigits) ;
AliTRDdigit * digit ;
while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
GetDigitsData(0)->Fill(digit->GetDetector());
GetDigitsData(1)->Fill(digit->GetTime());
GetDigitsData(2)->Fill(digit->GetAmp());
- }
+ }
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeSDigits(TTree * digits)
{
+ //
+ // Makes data from digits tree
+ //
AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
digitsManager->CreateArrays();
}
delete digitsManager;
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::MakeRaws(AliRawReader* rawReader)
{
+ //
// 157
// T9 -- T10
+ //
//const Int_t kSM = 18;
//const Int_t kROC = 30;
//____________________________________________________________________________
void AliTRDQADataMaker::MakeRecPoints(TTree * clustersTree)
{
-
- // makes data from RecPoints
+ //
+ // Makes data from RecPoints
//
Int_t nsize = Int_t(clustersTree->GetTotBytes() / (sizeof(AliTRDcluster)));
for(Int_t i=0; i<540; i++)
if (nDet[i] > 0) GetRecPointsData(9)->Fill(nDet[i]);
-
delete clusterArray;
+
}
//____________________________________________________________________________
void AliTRDQADataMaker::StartOfDetectorCycle()
{
- //Detector specific actions at start of cycle
+ //
+ // Detector specific actions at start of cycle
+ //
}
//__________________________________________________________________________
-Int_t AliTRDQADataMaker::CheckPointer(TObject *obj, const char *name) {
+Int_t AliTRDQADataMaker::CheckPointer(TObject *obj, const char *name)
+{
+ //
+ // Checks initialization of pointers
+ //
if (!obj) AliWarning(Form("null pointer: %s", name));
return !!obj;
+
}
-//__________________________________________________________________________
////////////////////////////////////////////////////////////////////////////
// //
-// Produces the data needed to calculate the quality assurance. //
-// All data must be mergeable objects. //
-// S.Radomski Uni-Heidelberg October 2007 //
+// Produces the data needed to calculate the quality assurance. //
+// All data must be mergeable objects. //
+// //
+// Author: //
+// Sylwester Radomski (radomski@physi.uni-heidelberg.de) //
// //
////////////////////////////////////////////////////////////////////////////
class AliTRDQADataMaker: public AliQADataMaker {
-public:
+ public:
AliTRDQADataMaker() ; // ctor
AliTRDQADataMaker(const AliTRDQADataMaker& qadm) ;
AliTRDQADataMaker& operator = (const AliTRDQADataMaker& qadm) ;
virtual ~AliTRDQADataMaker() {;} // dtor
-private:
+ private:
virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TList*) {};
virtual void EndOfDetectorCycle() ;
Int_t GetSector(const Double_t alpha) const;
Double_t GetExtZ(const AliExternalTrackParam *paramIn) const;
- ClassDef(AliTRDQADataMaker,1) // description
+ ClassDef(AliTRDQADataMaker,1) // Creates the TRD QA data
};
-
-#endif // AliTRDQADATAMAKER_H
+#endif
/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// This class provides access to TRD digits in raw data. //
-// //
-// It loops over all TRD digits in the raw data given by the AliRawReader. //
-// The Next method goes to the next digit. If there are no digits left //
-// it returns kFALSE. //
-// Several getters provide information about the current digit. //
-// //
-// Author: C. Lippmann (C.Lippmann@gsi.de) //
-// //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// This class provides access to TRD digits in raw data. //
+// //
+// It loops over all TRD digits in the raw data given by the AliRawReader //
+// The Next method goes to the next digit. If there are no digits left //
+// it returns kFALSE. //
+// Several getters provide information about the current digit. //
+// //
+// Author: //
+// Christian Lippmann (C.Lippmann@gsi.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
#include "AliLog.h"
#include "AliRawReader.h"
+
#include "AliTRDRawStream.h"
#include "AliTRDgeometry.h"
#include "AliTRDcalibDB.h"
-
#include "AliTRDdigitsManager.h"
#include "AliTRDdataArrayI.h"
#include "AliTRDSignalIndex.h"
-
#include "AliTRDfeeParam.h"
+
ClassImp(AliTRDRawStream)
//_____________________________________________________________________________
AliTRDRawStream::AliTRDRawStream()
:TObject()
+ ,fGeo(NULL)
,fSig()
,fADC(0)
,fTB(0)
,fSizeOK(kFALSE)
,fCountBytes(0)
,fBufSize(0)
- ,fkBufferSet(kFALSE)
+ ,fBufferSet(kFALSE)
,fPos(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
- ,fGeo(NULL)
{
//
// Default constructor
//_____________________________________________________________________________
AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader)
:TObject()
+ ,fGeo(NULL)
,fSig()
,fADC(0)
,fTB(0)
,fSizeOK(kFALSE)
,fCountBytes(0)
,fBufSize(0)
- ,fkBufferSet(kFALSE)
+ ,fBufferSet(kFALSE)
,fPos(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
- ,fGeo(NULL)
{
//
// Create an object to read TRD raw digits
//_____________________________________________________________________________
AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream)
:TObject(stream)
+ ,fGeo(NULL)
,fSig()
,fADC(-1)
,fTB(-1)
,fSizeOK(kFALSE)
,fCountBytes(0)
,fBufSize(0)
- ,fkBufferSet(kFALSE)
+ ,fBufferSet(kFALSE)
,fPos(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
- ,fGeo(NULL)
{
//
// Copy constructor
// Assigment operator
//
- Fatal("operator =", "assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
//_____________________________________________________________________________
void AliTRDRawStream::SetRawReader(AliRawReader *rawReader)
{
+ //
+ // Sets the raw reader
+ //
+
if (rawReader)
{
fRawReader = rawReader;
}
+
}
//_____________________________________________________________________________
}
-
//____________________________________________________________________________
Int_t AliTRDRawStream::Init()
{
fDataSize = 0;
fSizeOK = kFALSE;
- fNextStatus = fkStart;
+ fNextStatus = kStart;
fCountBytes = 0;
fBufSize = 0;
fDataWord = NULL;
fPos = NULL;
fWordCtr = 0;
- fkBufferSet = kFALSE;
+ fBufferSet = kFALSE;
+
return kTRUE;
+
}
//____________________________________________________________________________
if (fCountBytes + kSizeWord >= fBufSize)
{
- fkBufferSet = fRawReader->ReadNextData(fPos);
- if (fkBufferSet == kTRUE)
+ fBufferSet = fRawReader->ReadNextData(fPos);
+ if (fBufferSet == kTRUE)
{
fBufSize = fRawReader->GetDataSize();
fCountBytes = 0;
fDataWord = (UInt_t*)fPos;
- fNextStatus = fkNextSM;
+ fNextStatus = kNextSM;
fWordCtr = 0;
- return fkNextSM;
+ return kNextSM;
}
else
{
- fNextStatus = fkStop;
- return fkNoMoreData;
+ fNextStatus = kStop;
+ return kNoMoreData;
}
}
else
fCountBytes += kSizeWord;
fDataWord = (UInt_t*)fPos;
fWordCtr++;
- return fkWordOK;
+ return kWordOK;
}
}
// Updates the next data word pointer
//
- if (fNextStatus == fkStart)
+ if (fNextStatus == kStart)
{
Init();
}
- while (fNextStatus != fkStop)
- { // !fkStop
+ while (fNextStatus != kStop)
+ { // !kStop
NextData();
- if (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
+ if (fNextStatus == kNextMCM || fNextStatus == kNextData)
{
fHCdataCtr += 4;
{
AliWarning("Wrong fMCM or fROB. Skip this data");
fRawReader->AddMajorErrorLog(kWrongMCMorROB,Form("MCM=%d, ROB=%d",fMCM,fROB));
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
fTbSwitch = 3; // For first adc channel we expect: (*fDataWord & 3) = 3
fTbSwitchCtr = 0; //
fADC = fTB = 0; // Reset Counter
- fNextStatus = fkNextData;
+ fNextStatus = kNextData;
continue;
}
if ( *fDataWord == kEndofrawdatamarker )
{ // End of half-chamber data, finished
fGTUctr1 = -1;
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
- if (fNextStatus == fkNextData )
+ if (fNextStatus == kNextData )
{ // MCM header is set, ADC data is valid.
// Found some data. Decode it now:
if ( fRetVal == 0 ) continue;
if ( fRetVal == -1 )
{
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
if ( fRetVal == 1)
// {
// fCOL = -1;
// }
- }// fkNextData
+ }// kNextData
continue;
} //next mcm
- if ( fNextStatus == fkNextHC )
+ if ( fNextStatus == kNextHC )
{
//
// 1) Find end_of_tracklet_marker
if ( *fDataWord == kEndoftrackletmarker )
{
AliDebug(3, "end-of-tracklet-marker found");
- fNextStatus = fkSeekNonEoTracklet;
+ fNextStatus = kSeekNonEoTracklet;
continue;
}
else
}
} //if next HC
- if (fNextStatus == fkSeekNonEoTracklet)
+ if (fNextStatus == kSeekNonEoTracklet)
{
//
// 2) Look for non-end_of_tracklet_marker
if ( *fDataWord != kEndoftrackletmarker )
{
- fNextStatus = fkDecodeHC;
+ fNextStatus = kDecodeHC;
AliDebug(3, "NON end-of-tracklet-marker found");
//// no do not continue - this should be the hcheader
}
}
}
- if ( fNextStatus == fkDecodeHC )
+ if ( fNextStatus == kDecodeHC )
{
AliDebug(3, "Decode HC");
fHCdataCtr = 0;
fChamberDone[fDET]++;
- fNextStatus = fkNextMCM;
+ fNextStatus = kNextMCM;
AliDebug(3, "Decode HC OK");
continue;
} //HC header
else
{
AliDebug(3, "Decode HC NOT OK");
- fNextStatus = fkNextSM;
+ fNextStatus = kNextSM;
continue;
}
} // if decode HC
- if (fNextStatus == fkNextSM)
+ if (fNextStatus == kNextSM)
{
fDET = 0;
if ( (*fDataWord & 0xfffff000) == 0xe0000000 )
{
DecodeGTUlinkMask();
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
else
{
AliWarning(Form("Equipment %d: First data word is not GTU Link Mask!", fEqID));
fRawReader->AddMajorErrorLog(kGTULinkMaskMissing,Form("Equipment %d",fEqID));
- fNextStatus = fkStop;
+ fNextStatus = kStop;
}
}// if nextSM
- } // not fkStop
+ } // not kStop
AliDebug(1, Form("That's all folks! %d", fSM));
return kFALSE;
AliTRDdataArrayI *track2 = 0;
AliTRDSignalIndex *indexes = 0;
- if (fNextStatus == fkStart)
+ if (fNextStatus == kStart)
{
Init();
}
- while (fNextStatus != fkStop)
- { // !fkStop
+ while (fNextStatus != kStop)
+ { // !kStop
NextData();
- if (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
- //while (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
+ if (fNextStatus == kNextMCM || fNextStatus == kNextData)
+ //while (fNextStatus == kNextMCM || fNextStatus == kNextData)
{
fHCdataCtr += 4;
{
AliWarning("Wrong fMCM or fROB. Skip this data");
fRawReader->AddMajorErrorLog(kWrongMCMorROB,Form("MCM=%d, ROB=%d",fMCM,fROB));
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
fTbSwitch = 3; // For first adc channel we expect: (*fDataWord & 3) = 3
fTbSwitchCtr = 0; //
fADC = fTB = 0; // Reset Counter
- fNextStatus = fkNextData;
+ fNextStatus = kNextData;
// NextData(); // if while loop!
continue; // if if
if ( *fDataWord == kEndofrawdatamarker )
{ // End of half-chamber data, finished
fGTUctr1 = -1;
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
// full chamber processed ?
if (fChamberDone[fDET] == 2)
{
}
}
- if (fNextStatus == fkNextData )
+ if (fNextStatus == kNextData )
{ // MCM header is set, ADC data is valid.
// Found some data. Decode it now:
if ( fRetVal == 0 ) continue;
if ( fRetVal == -1 )
{
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
// NextData(); // if while loop!
// break; //if while loop!
// {
// fCOL = -1;
// }
- }// fkNextData
+ }// kNextData
// NextData(); // if while loop!
continue; //if if
} //next mcm
- if ( fNextStatus == fkNextHC )
+ if ( fNextStatus == kNextHC )
{
//
// 1) Find end_of_tracklet_marker
if ( *fDataWord == kEndoftrackletmarker )
{
AliDebug(3, "end-of-tracklet-marker found");
- fNextStatus = fkSeekNonEoTracklet;
+ fNextStatus = kSeekNonEoTracklet;
continue;
}
else
}
} //if next HC
- if (fNextStatus == fkSeekNonEoTracklet)
+ if (fNextStatus == kSeekNonEoTracklet)
{
//
// 2) Look for non-end_of_tracklet_marker
if ( *fDataWord != kEndoftrackletmarker )
{
- fNextStatus = fkDecodeHC;
+ fNextStatus = kDecodeHC;
AliDebug(3, "NON end-of-tracklet-marker found");
//// no do not continue - this should be the hcheader
}
}
}
- if ( fNextStatus == fkDecodeHC )
+ if ( fNextStatus == kDecodeHC )
{
AliDebug(3, "Decode HC");
fHCdataCtr = 0;
fChamberDone[fDET]++;
- fNextStatus = fkNextMCM;
+ fNextStatus = kNextMCM;
AliDebug(3, "Decode HC OK");
continue;
} //HC header
else
{
AliDebug(3, "Decode HC NOT OK");
- fNextStatus = fkNextSM;
+ fNextStatus = kNextSM;
continue;
}
} // if decode HC
- if (fNextStatus == fkNextSM)
+ if (fNextStatus == kNextSM)
{
fDET = 0;
if ( (*fDataWord & 0xfffff000) == 0xe0000000 )
{
DecodeGTUlinkMask();
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
continue;
}
else
{
AliWarning(Form("Equipment %d: First data word is not GTU Link Mask!", fEqID));
fRawReader->AddMajorErrorLog(kGTULinkMaskMissing,Form("Equipment %d",fEqID));
- fNextStatus = fkStop;
+ fNextStatus = kStop;
}
}// if nextSM
- } // not fkStop
+ } // not kStop
AliDebug(1, Form("That's all folks! %d", fSM));
//return kFALSE;
// 2nd word (h[1])
if ( fHCHWords >= 1 ) {
// read one more word
- if (NextData() != fkWordOK)
+ if (NextData() != kWordOK)
{
AliWarning("Next HC word missing");
fRawReader->AddMajorErrorLog(kHCWordMissing,"Next HC word missing");
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
return;
}
if ( (*fDataWord & 0x3) == 1 ) {
// 3nd word (h[2])
if ( fHCHWords >= 2 ) {
// read one more word
- if (NextData() != fkWordOK)
+ if (NextData() != kWordOK)
{
AliWarning("Next HC word missing");
fRawReader->AddMajorErrorLog(kHCWordMissing,"Next HC word missing");
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
return;
}
if ( (*fDataWord & 0x3) == 1 ) {
// AdcMask for Zero supressed data
if ( fRawVersion == 3 ) {
// read one more word
- if (NextData() != fkWordOK)
+ if (NextData() != kWordOK)
{
AliWarning("MCM ADC mask missing");
fRawReader->AddMajorErrorLog(kMCMADCMaskMissing,"Missing");
- fNextStatus = fkNextHC;
+ fNextStatus = kNextHC;
return;
}
if ( (*fDataWord & 0x000007ff) == 0xC ) { // at the moment bits 4-10 are empty
/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// This class provides access to TRD digits in raw data. //
-// //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// This class provides access to TRD digits in raw data. //
+// //
+////////////////////////////////////////////////////////////////////////////
#include <TObject.h>
-class AliTRDgeometry;
class AliRawReader;
+
+class AliTRDgeometry;
class AliTRDdigitsManager;
// Some constants:
const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
const UInt_t kEndofrawdatamarker = 0x00000000; /*This marks the end of half-chamber-data*/
-const UInt_t kSizeWord = sizeof(UInt_t);
+const UInt_t kSizeWord = sizeof(UInt_t);
class AliTRDRawStream: public TObject {
AliTRDRawStream(AliRawReader *rawReader);
virtual ~AliTRDRawStream();
- virtual Bool_t Next(); // Read the next data
- virtual Int_t NextChamber(AliTRDdigitsManager *man); // read next chamber data
- virtual Int_t Init(); // Init for the fRawVersion > 1
+ virtual Bool_t Next(); // Read the next data
+ virtual Int_t NextChamber(AliTRDdigitsManager *man); // Read next chamber data
+ virtual Int_t Init(); // Init for the fRawVersion > 1
- enum { kDDLOffset = 0x400 }; // Offset for DDL numbers
+ enum { kDDLOffset = 0x400 }; // Offset for DDL numbers
Bool_t SetRawVersion(Int_t rv);
Int_t GetRawVersion() const { return fRawVersion; };
Bool_t IsGTULinkActive(Int_t sm, Int_t la, Int_t sta, Int_t side)
{ return ( ((fGTUlinkMask[sm][sta]) >> (2*la+side)) & 0x1 ); };
- Int_t *GetSignals() { return fSig;} // Signals in the three time bins from Data Word
- Int_t GetADC() const { return fADC;} // MCM ADC channel and Time Bin of word 1
- Int_t GetTimeBin() const { return fTB - 3;} // MCM ADC channel and Time Bin of word 1
- Int_t GetEventNumber() const { return fEv;} // MCM Event number and position of current MCM on TRD chamber
- Int_t GetROB() const { return fROB;} // MCM Event number and position of current MCM on TRD chamber
- Int_t GetMCM() const { return fMCM;} // MCM Event number and position of current MCM on TRD chamber
- Int_t GetSM() const { return fSM;} // Position of CURRENT half chamber in full TRD
- Int_t GetLayer() const { return fLAYER;} // PLANE = Position of CURRENT half chamber in full TRD
- Int_t GetStack() const { return fSTACK;} // CHAMBER = Position of CURRENT half chamber in full TRD
- Int_t GetROC() const { return fROC;} // Position of CURRENT half chamber in full TRD
- Int_t GetSide() const { return fSIDE;} // Position of CURRENT half chamber in full TRD
- Int_t GetDCS() const { return fDCS;} // DCS board number read from data (HC header)
- Int_t GetRow() const { return fROW;}
- Int_t GetCol() const { return fCOL;} // Detector Pad coordinates
- Int_t GetDet() const { return fDET;} // helper
- Int_t GetLastDet() const { return fLastDET;} // helper
- Int_t GetMaxRow() const { return fRowMax;}
- Int_t GetMaxCol() const { return fColMax;}
- Int_t GetNumberOfTimeBins() const {return fTBins;}
+ Int_t *GetSignals() { return fSig; } // Signals in the three time bins from Data Word
+ Int_t GetADC() const { return fADC; } // MCM ADC channel and Time Bin of word 1
+ Int_t GetTimeBin() const { return fTB - 3; } // MCM ADC channel and Time Bin of word 1
+ Int_t GetEventNumber() const { return fEv; } // MCM Event number and position of current MCM
+ Int_t GetROB() const { return fROB; } // MCM Event number and position of current MCM
+ Int_t GetMCM() const { return fMCM; } // MCM Event number and position of current MCM
+ Int_t GetSM() const { return fSM; } // Position of CURRENT half chamber in full TRD
+ Int_t GetLayer() const { return fLAYER; } // PLANE = Position of CURRENT half chamber in full TRD
+ Int_t GetStack() const { return fSTACK; } // CHAMBER = Position of CURRENT half chamber in full TRD
+ Int_t GetROC() const { return fROC; } // Position of CURRENT half chamber in full TRD
+ Int_t GetSide() const { return fSIDE; } // Position of CURRENT half chamber in full TRD
+ Int_t GetDCS() const { return fDCS; } // DCS board number read from data (HC header)
+ Int_t GetRow() const { return fROW; }
+ Int_t GetCol() const { return fCOL; } // Detector Pad coordinates
+ Int_t GetDet() const { return fDET; } // Helper
+ Int_t GetLastDet() const { return fLastDET; } // Helper
+ Int_t GetMaxRow() const { return fRowMax; }
+ Int_t GetMaxCol() const { return fColMax; }
+ Int_t GetNumberOfTimeBins() const { return fTBins; }
+
+ protected:
+
+ AliTRDgeometry *fGeo; // TRD geometry
+
+ void DecodeHCheader(Int_t timeBins);
+ void DecodeMCMheader();
+ void DecodeTracklet();
+ void DecodeGTUlinkMask();
+ Int_t DecodeDataWord();
+ Int_t DecodeDataWordV1V2(); // Valid for fRawversion = 1, 2, ...
+ Int_t DecodeDataWordV3(); // Valid for fRawversion = 3, ...
+
+ Int_t NextData(); // Get the next piece of memory
+
+ enum { kStart
+ , kStop
+ , kWordOK
+ , kNoMoreData
+ , kNextSM
+ , kNextHC
+ , kSeekNonEoTracklet
+ , kDecodeHC
+ , kNextMCM
+ , kNextData
+ , kReading };
private :
Bool_t fSizeOK; // Did we read anything
UInt_t fCountBytes; // Bytes traversed in the buffer
UInt_t fBufSize; // Size of the current RawReader buffer
- Bool_t fkBufferSet; // Is the RawReader buffer available
+ Bool_t fBufferSet; // Is the RawReader buffer available
UChar_t *fPos; // Position in the buffer of the RawReader
UInt_t *fDataWord; // The pointer to the current 32 bit data word
UInt_t fTimeBinsCalib; // N of time bins retrieved from calibration
,kADCNumberOverflow = 12 //
,kADCChannelOverflow = 13 //
};
-
- protected:
-
- AliTRDgeometry *fGeo; // TRD geometry
-
- void DecodeHCheader(Int_t timeBins);
- void DecodeMCMheader();
- void DecodeTracklet();
- void DecodeGTUlinkMask();
- Int_t DecodeDataWord();
- Int_t DecodeDataWordV1V2(); // Valid for fRawversion = 1, 2, ...
- Int_t DecodeDataWordV3(); // Valid for fRawversion = 3, ...
-
- Int_t NextData(); // get the next piece of memory
-
- enum { fkStart, fkStop, fkWordOK, fkNoMoreData, fkNextSM, fkNextHC, fkSeekNonEoTracklet, fkDecodeHC, fkNextMCM, fkNextData, fkReading};
- ClassDef(AliTRDRawStream, 5) // Class for reading TRD raw digits
+ ClassDef(AliTRDRawStream, 6) // Class for reading TRD raw digits
};
#endif
// This is a singleton, constructor is private!
AliTRDRecParam();
- ~AliTRDRecParam();
+ virtual ~AliTRDRecParam();
ClassDef(AliTRDRecParam,1) // The reconstruction parameter
// General container for data from TRD detector segments //
// Adapted from AliDigits, origin M.Ivanov //
// //
-// Author: M. Ploskon (ploskon@ikf.uni-frankfurt.de) //
+// Author: //
+// Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de) //
// //
///////////////////////////////////////////////////////////////////////////////
-#include "AliTRDSignalIndex.h"
-
#include "TArrayI.h"
+
#include "AliLog.h"
+#include "AliTRDSignalIndex.h"
+
ClassImp(AliTRDSignalIndex)
//_____________________________________________________________________________
AliTRDSignalIndex::AliTRDSignalIndex()
- : TObject()
- , fDet(-1)
- , fLayer(-1)
- , fStack(-1)
- , fSM(-1)
- , fIndex(NULL)
- , fPositionRow(0)
- , fPositionCol(0)
- , fPositionTbin(0)
- , fLastRow(0)
- , fLastCol(0)
- , fLastTbin(0)
- , fNrows(0)
- , fNcols(0)
- , fNtbins(0)
- , fMaxLimit(0)
- , fResetCounters(kTRUE)
- , fHasEntry(kFALSE)
+ :TObject()
+ ,fDet(-1)
+ ,fLayer(-1)
+ ,fStack(-1)
+ ,fSM(-1)
+ ,fIndex(NULL)
+ ,fPositionRow(0)
+ ,fPositionCol(0)
+ ,fPositionTbin(0)
+ ,fLastRow(0)
+ ,fLastCol(0)
+ ,fLastTbin(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fNtbins(0)
+ ,fMaxLimit(0)
+ ,fResetCounters(kTRUE)
+ ,fHasEntry(kFALSE)
{
//
- // default contructor
+ // Default contructor
//
+
ResetCounters();
+
}
//_____________________________________________________________________________
AliTRDSignalIndex::AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime)
- : TObject()
- , fDet(-1)
- , fLayer(-1)
- , fStack(-1)
- , fSM(-1)
- , fIndex(NULL)
- , fPositionRow(0)
- , fPositionCol(0)
- , fPositionTbin(0)
- , fLastRow(0)
- , fLastCol(0)
- , fLastTbin(0)
- , fNrows(0)
- , fNcols(0)
- , fNtbins(0)
- , fMaxLimit(0)
- , fResetCounters(kTRUE)
- , fHasEntry(kFALSE)
+ :TObject()
+ ,fDet(-1)
+ ,fLayer(-1)
+ ,fStack(-1)
+ ,fSM(-1)
+ ,fIndex(NULL)
+ ,fPositionRow(0)
+ ,fPositionCol(0)
+ ,fPositionTbin(0)
+ ,fLastRow(0)
+ ,fLastCol(0)
+ ,fLastTbin(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fNtbins(0)
+ ,fMaxLimit(0)
+ ,fResetCounters(kTRUE)
+ ,fHasEntry(kFALSE)
{
- // not the default contructor... hmmm...
+ //
+ // Not the default contructor... hmmm...
+ //
+
Allocate(nrow, ncol, ntime);
+
}
//_____________________________________________________________________________
-AliTRDSignalIndex::~AliTRDSignalIndex()
+AliTRDSignalIndex::AliTRDSignalIndex(const AliTRDSignalIndex &a)
+ :TObject(a)
+ ,fDet(a.fDet)
+ ,fLayer(a.fLayer)
+ ,fStack(a.fStack)
+ ,fSM(a.fSM)
+ ,fIndex(a.fIndex)
+ ,fPositionRow(a.fPositionRow)
+ ,fPositionCol(a.fPositionCol)
+ ,fPositionTbin(a.fPositionTbin)
+ ,fLastRow(a.fLastRow)
+ ,fLastCol(a.fLastCol)
+ ,fLastTbin(a.fLastTbin)
+ ,fNrows(a.fNrows)
+ ,fNcols(a.fNcols)
+ ,fNtbins(a.fNtbins)
+ ,fMaxLimit(a.fMaxLimit)
+ ,fResetCounters(a.fResetCounters)
+ ,fHasEntry(a.fHasEntry)
{
//
- // Destructor
+ // Copy constructor
//
- delete fIndex;
- fIndex = NULL;
}
//_____________________________________________________________________________
-AliTRDSignalIndex::AliTRDSignalIndex(const AliTRDSignalIndex &a)
- : TObject(a)
- , fDet(a.fDet)
- , fLayer(a.fLayer)
- , fStack(a.fStack)
- , fSM(a.fSM)
- , fIndex(a.fIndex)
- , fPositionRow(a.fPositionRow)
- , fPositionCol(a.fPositionCol)
- , fPositionTbin(a.fPositionTbin)
- , fLastRow(a.fLastRow)
- , fLastCol(a.fLastCol)
- , fLastTbin(a.fLastTbin)
- , fNrows(a.fNrows)
- , fNcols(a.fNcols)
- , fNtbins(a.fNtbins)
- , fMaxLimit(a.fMaxLimit)
- , fResetCounters(a.fResetCounters)
- , fHasEntry(a.fHasEntry)
+AliTRDSignalIndex::~AliTRDSignalIndex()
{
//
- // Copy constructor
+ // Destructor
//
+
+ delete fIndex;
+ fIndex = NULL;
+
}
//_____________________________________________________________________________
// Copy function
//
- ((AliTRDSignalIndex &)a).fDet = fDet;
- ((AliTRDSignalIndex &)a).fLayer = fLayer;
- ((AliTRDSignalIndex &)a).fStack = fStack;
- ((AliTRDSignalIndex &)a).fSM = fSM;
- ((AliTRDSignalIndex &)a).fIndex = fIndex;
- ((AliTRDSignalIndex &)a).fPositionRow = fPositionRow;
- ((AliTRDSignalIndex &)a).fPositionTbin = fPositionTbin;
- ((AliTRDSignalIndex &)a).fLastRow = fLastRow;
- ((AliTRDSignalIndex &)a).fLastCol = fLastCol;
- ((AliTRDSignalIndex &)a).fLastTbin = fLastTbin;
- ((AliTRDSignalIndex &)a).fNrows = fNrows;
- ((AliTRDSignalIndex &)a).fNcols = fNcols;
- ((AliTRDSignalIndex &)a).fNtbins = fNtbins;
- ((AliTRDSignalIndex &)a).fMaxLimit = fMaxLimit;
+ ((AliTRDSignalIndex &)a).fDet = fDet;
+ ((AliTRDSignalIndex &)a).fLayer = fLayer;
+ ((AliTRDSignalIndex &)a).fStack = fStack;
+ ((AliTRDSignalIndex &)a).fSM = fSM;
+ ((AliTRDSignalIndex &)a).fIndex = fIndex;
+ ((AliTRDSignalIndex &)a).fPositionRow = fPositionRow;
+ ((AliTRDSignalIndex &)a).fPositionTbin = fPositionTbin;
+ ((AliTRDSignalIndex &)a).fLastRow = fLastRow;
+ ((AliTRDSignalIndex &)a).fLastCol = fLastCol;
+ ((AliTRDSignalIndex &)a).fLastTbin = fLastTbin;
+ ((AliTRDSignalIndex &)a).fNrows = fNrows;
+ ((AliTRDSignalIndex &)a).fNcols = fNcols;
+ ((AliTRDSignalIndex &)a).fNtbins = fNtbins;
+ ((AliTRDSignalIndex &)a).fMaxLimit = fMaxLimit;
((AliTRDSignalIndex &)a).fResetCounters = fResetCounters;
- ((AliTRDSignalIndex &)a).fHasEntry = fHasEntry;
+ ((AliTRDSignalIndex &)a).fHasEntry = fHasEntry;
+
}
//_____________________________________________________________________________
return *this;
}
+
//_____________________________________________________________________________
void AliTRDSignalIndex::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
{
//
- // create the arrays
+ // Create the arrays
//
fNrows = nrow;
fNtbins = ntime;
fMaxLimit = nrow * ncol * ntime + nrow * ncol * 2;
- if (fIndex)
- {
- delete fIndex;
- fIndex = NULL;
- }
+ if (fIndex) {
+ delete fIndex;
+ fIndex = NULL;
+ }
fIndex = new TArrayI(fMaxLimit);
- //fIndex->Set(fMaxLimit);
fIndex->Reset(-1);
+
ResetCounters();
+
fHasEntry = kFALSE;
+
}
//_____________________________________________________________________________
// Reset the array but keep the size - realloc
//
- fDet = -1;
+ fDet = -1;
fLayer = -1;
fStack = -1;
- fSM = -1;
+ fSM = -1;
- // all will be lost
+ // All will be lost
Allocate(fNrows, fNcols, fNtbins);
+
}
//_____________________________________________________________________________
fIndex->Reset(-1);
ResetCounters();
+
fHasEntry = kFALSE;
+
}
//_____________________________________________________________________________
// Reset the array but keep the size if no need to enlarge - no realloc
//
- fDet = -1;
+ fDet = -1;
fLayer = -1;
fStack = -1;
- fSM = -1;
+ fSM = -1;
+
+ if ((nrow > fNrows) ||
+ (ncol > fNcols) ||
+ (ntime > fNtbins)) {
+ Allocate(nrow, ncol, ntime);
+ }
+ else {
+ fIndex->Reset(-1);
+ ResetCounters();
+ fHasEntry = kFALSE;
+ }
- if (nrow > fNrows || ncol > fNcols || ntime > fNtbins)
- {
- Allocate(nrow, ncol, ntime);
- }
- else
- {
- fIndex->Reset(-1);
- ResetCounters();
- fHasEntry = kFALSE;
- }
}
-
//_____________________________________________________________________________
void AliTRDSignalIndex::ClearAll()
{
// Reset the values - clear all!
//
- fDet = -1;
- fLayer = -1;
- fStack = -1;
- fSM = -1;
+ fDet = -1;
+ fLayer = -1;
+ fStack = -1;
+ fSM = -1;
- fNrows = -1;
- fNcols = -1;
+ fNrows = -1;
+ fNcols = -1;
fNtbins = -1;
- if (fIndex)
- {
- delete fIndex;
- fIndex = NULL;
- }
+ if (fIndex) {
+ delete fIndex;
+ fIndex = NULL;
+ }
fIndex = new TArrayI();
ResetCounters();
+
fHasEntry = kFALSE;
+
}
//_____________________________________________________________________________
void AliTRDSignalIndex::AddIndexTBin(Int_t row, Int_t col, Int_t tbin)
{
- // store the index row-column-tbin as an interesting one
- // the RC index is updated to!!!
- // this is to be used in the TRD clusterizer!
-
- //if (fPositionCol + fNtbins >= fMaxLimit)
- if (row * col * tbin + row * col * 2 >= fMaxLimit)
- {
- AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d", fPositionCol + fNtbins, fMaxLimit));
- return;
- }
+ //
+ // Store the index row-column-tbin as an interesting one
+ // The RC index is updated to!!!
+ // This is to be used in the TRD clusterizer!
+ //
+
+ if (row * col * tbin + row * col * 2 >= fMaxLimit) {
+ AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d"
+ ,fPositionCol + fNtbins
+ ,fMaxLimit));
+ return;
+ }
+
+ if ((row != fLastRow) ||
+ (col != fLastCol)) {
- if (row != fLastRow || col != fLastCol)
- {
- // new RC combination
- if (fResetCounters == kTRUE)
- {
- fPositionRow = 0;
- fPositionCol = 1;
-
- fResetCounters = kFALSE;
- }
- else
- {
- fPositionRow += fNtbins + 2;
- fPositionCol += fNtbins + 2;
- }
-
- fPositionTbin = 1;
-
- (*fIndex)[fPositionRow] = row;
- (*fIndex)[fPositionCol] = col;
- (*fIndex)[fPositionCol + fPositionTbin] = tbin;
- //AliInfo(Form("x1: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
- ++fPositionTbin;
+ // New RC combination
+ if (fResetCounters == kTRUE) {
+ fPositionRow = 0;
+ fPositionCol = 1;
+ fResetCounters = kFALSE;
}
- else
- {
- // same RCT combination ?
- // if (fLastTbin == tbin)
- // {
- // AliWarning(Form("Same RCT? %d %d %d", row, col, tbin));
- // }
-
- (*fIndex)[fPositionCol + fPositionTbin] = tbin;
- //AliInfo(Form("x2: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
- ++fPositionTbin;
+ else {
+ fPositionRow += fNtbins + 2;
+ fPositionCol += fNtbins + 2;
}
+
+ fPositionTbin = 1;
+
+ (*fIndex)[fPositionRow] = row;
+ (*fIndex)[fPositionCol] = col;
+ (*fIndex)[fPositionCol + fPositionTbin] = tbin;
+ ++fPositionTbin;
+
+ }
+ else {
+
+ // Same RCT combination ?
+
+ (*fIndex)[fPositionCol + fPositionTbin] = tbin;
+ ++fPositionTbin;
+
+ }
fLastRow = row;
fLastCol = col;
fLastTbin = tbin;
fHasEntry = kTRUE;
+
}
//_____________________________________________________________________________
Bool_t AliTRDSignalIndex::NextRCIndex(Int_t &row, Int_t &col)
{
- // return the position (index in the data array) of the next available pad
-
- if (fResetCounters == kTRUE)
- {
- fPositionRow = 0;
- fPositionCol = 1;
-
- fResetCounters = kFALSE;
- //AliDebug(2, "Reset counters");
- }
- else
- {
- fPositionRow += fNtbins + 2;
- fPositionCol += fNtbins + 2;
- }
+ //
+ // Return the position (index in the data array) of the next available pad
+ //
- if (fPositionRow >= fMaxLimit)
- {
- //AliDebug(8, "Out of index range");
- return kFALSE;
- }
+ if (fResetCounters == kTRUE) {
+ fPositionRow = 0;
+ fPositionCol = 1;
+ fResetCounters = kFALSE;
+ }
+ else {
+ fPositionRow += fNtbins + 2;
+ fPositionCol += fNtbins + 2;
+ }
- //AliDebug(8, Form("Next RC %d", fPositionRow / (fNtbins + 2)));
+ if (fPositionRow >= fMaxLimit) {
+ return kFALSE;
+ }
fPositionTbin = 1;
row = (*fIndex)[fPositionRow];
col = (*fIndex)[fPositionCol];
- if (row > -1 && col > -1)
+ if ((row > -1) &&
+ (col > -1)) {
return kTRUE;
+ }
return kFALSE;
+
}
//_____________________________________________________________________________
-Bool_t AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
+Bool_t AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
{
- // return the position (index in the data array) of the next available tbin
+ //
+ // Return the position (index in the data array) of the next available tbin
// within the current pad
+ //
- if (fPositionRow >= fMaxLimit)
- {
- //AliDebug(8, "Out of index range");
- return kFALSE;
- }
+ if (fPositionRow >= fMaxLimit) {
+ return kFALSE;
+ }
- if (NextTbinIndex(tbin))
- {
- row = (*fIndex)[fPositionRow];
- col = (*fIndex)[fPositionCol];
- fResetCounters = kFALSE;
- return kTRUE;
- }
- else
- {
- if (NextRCIndex(row, col))
- {
- return NextRCTbinIndex(row, col, tbin);
- }
+ if (NextTbinIndex(tbin)) {
+ row = (*fIndex)[fPositionRow];
+ col = (*fIndex)[fPositionCol];
+ fResetCounters = kFALSE;
+ return kTRUE;
+ }
+ else {
+ if (NextRCIndex(row, col)) {
+ return NextRCTbinIndex(row, col, tbin);
}
+ }
return kFALSE;
+
}
//_____________________________________________________________________________
-Bool_t AliTRDSignalIndex::NextTbinIndex(Int_t &tbin)
+Bool_t AliTRDSignalIndex::NextTbinIndex(Int_t &tbin)
{
- // return the position (index in the data array) of the next available tbin
+ //
+ // Return the position (index in the data array) of the next available tbin
// within the current pad
+ //
- if (fPositionCol + fPositionTbin >= fMaxLimit || fPositionTbin > fNtbins)
- {
- //AliDebug(8, "Out of index range");
- return kFALSE;
- }
+ if ((fPositionCol + fPositionTbin >= fMaxLimit) ||
+ (fPositionTbin > fNtbins )) {
+ return kFALSE;
+ }
tbin = (*fIndex)[fPositionCol + fPositionTbin];
- if (tbin > -1)
- {
- ++fPositionTbin;
- return kTRUE;
- }
+ if (tbin > -1) {
+ ++fPositionTbin;
+ return kTRUE;
+ }
return kFALSE;
+
}
-// void AliTRDSignalIndex::Dump()
-// {
-// AliInfo("R C T...");
-// Int_t i = 0;
-// Int_t rcok = 0;
-// while ( i < fMaxLimit )
-// {
-// if (i % (fNtbins + 2) == 0)
-// {
-// if ((*(*fIndex))[i] > -1)
-// {
-// rcok = 1;
-// printf("\n RC : ");
-// }
-// else
-// rcok = 0;
-// }
-// if (rcok)
-// if ((*(*fIndex))[i] > -1)
-// printf("[%d] = %d \t", i, (*(*fIndex))[i]);
-// i++;
-// }
-// }
-
-// //_____________________________________________________________________________
-// void AliTRDSignalIndex::Dump()
-// {
-// //
-// // Dump the data
-// //
-
-// AliInfo("R C T...");
-// Int_t i = 0;
-// Int_t rcok = 0;
-// while ( i < fMaxLimit )
-// {
-// if (i % (fNtbins + 2) == 0)
-// {
-// if ((*fIndex)[i] > -1)
-// {
-// rcok = 1;
-// printf("\n RC : ");
-// }
-// else
-// rcok = 0;
-// }
-// if (rcok)
-// if ((*fIndex)[i] > -1)
-// printf("[%d] = %d \t", i, (*fIndex)[i]);
-// i++;
-// }
-// }
-
-// //_____________________________________________________________________________
-// void AliTRDSignalIndex::Dump2()
-// {
-// //
-// // Dump the data
-// //
-
-// AliInfo("R C T...");
-// Int_t ir, ic, it;
-// ResetCounters();
-// while (NextRCIndex(ir, ic))
-// {
-// printf("\nR %d C %d t : ", ir, ic);
-// while (NextTbinIndex(it))
-// printf("%d ", it);
-// }
-// printf("\n");
-// }
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetCounters()
+{
+ //
+ // Reset the counters/iterators
+ //
+
+ fPositionRow = 0;
+ fPositionCol = fPositionRow + 1;
+ fPositionTbin = 1;
+ fLastRow = -1;
+ fLastCol = -1;
+ fLastTbin = -1;
+ fResetCounters = kTRUE;
+
+}
#include "TObject.h"
-/////////////////////////////////////////////////////////////
-// General container for data from TRD detector segments //
-// Adapted from AliDigits, origin M.Ivanov //
-/////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// General container for data from TRD detector segments //
+// Adapted from AliDigits, origin M.Ivanov //
+// //
+// Author: //
+// Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de) //
+// //
+////////////////////////////////////////////////////////////////////////////
-//class TArrayI;
#include "TArrayI.h"
class AliTRDSignalIndex : public TObject
{
+
public:
AliTRDSignalIndex();
AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime);
AliTRDSignalIndex(const AliTRDSignalIndex &d);
- virtual ~AliTRDSignalIndex(); // destructor
+ virtual ~AliTRDSignalIndex();
AliTRDSignalIndex &operator=(const AliTRDSignalIndex &d);
- virtual void Copy(TObject &d) const;
- virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
- virtual void Reset();
-
- virtual void ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime);
- virtual void ResetContent();
-
- virtual void ResetCounters()
- {
- // reset the counters/iterators
- fPositionRow = 0;
- fPositionCol = fPositionRow + 1;
- fPositionTbin = 1;
-
- fLastRow = -1;
- fLastCol = -1;
- fLastTbin = -1;
-
- fResetCounters = kTRUE;
- }
-
- virtual void ResetTbinCounter()
- {
- // reset the time bin counter
-
- fPositionTbin = 1;
- }
-
- virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
-
- Bool_t NextRCIndex(Int_t &row, Int_t &col); // get the next pad (row and column) and return kTRUE on success
- Bool_t NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); // get the next timebin of a pad (row and column) and return kTRUE on success
- Bool_t NextTbinIndex(Int_t &tbin); // get the next active timebin and return kTRUE on success
-
- Int_t GetCurrentRow() {return (*fIndex)[fPositionRow];} // current row
- Int_t GetCurrentCol() {return (*fIndex)[fPositionCol];} // current col
- Int_t GetCurtentTbin() {return (*fIndex)[fPositionCol + fPositionTbin];} //current tbin
-
- void ClearAll(); // clear the array, actually destroy and recreate w/o allocating
-
- //void Dump(); // printf content - one way of iterating demo
- //void Dump2(); // printf content - another way of iterating demo
-
- //Bool_t IsAllocated() const {if (fIndex) return kTRUE; else return kFALSE;}
- Bool_t IsAllocated() const
- {
- // return kTRUE if array allocated and there is no need to call allocate
- if (!fIndex)
- return kFALSE;
- if (fIndex->GetSize() <= 0)
- return kFALSE;
- else return kTRUE;
- }
-
- void SetSM(Int_t ix)
- {
- // Set which SM
- fSM = ix;
- };
-
- void SetStack(Int_t ix)
- {
- // Set which stack
- fStack = ix;
- };
-
- void SetChamber(Int_t ix)
- {
- // aka set stack
- SetStack(ix);
- }
-
- void SetLayer(Int_t ix)
- {
- // Set which layer
- fLayer = ix;
- };
-
- void SetPlane(Int_t ix)
- {
- // aka set plane
- SetLayer(ix);
- }
-
- void SetDetNumber(Int_t ix)
- {
- // Set Det Number
- fDet = ix;
- }
-
- virtual Int_t GetDetNumber() const {return fDet;} // Get Det number
- virtual Int_t GetLayer() const {return fLayer;} // Layer = Plane = position of the chamber in TRD
- virtual Int_t GetPlane() const {return fLayer;} // Layer = Plane = position of the chamber in TRD
- virtual Int_t GetStack() const {return fStack;} // Stack = Chameber = position of the chamber in TRD
- virtual Int_t GetChamber() const {return fStack;} // Stack = Chameber = position of the chamber in TRD
- virtual Int_t GetSM() const {return fSM;} // Super module of the TRD
- virtual Bool_t HasEntry() const {return fHasEntry;} // Return status if has an entry
+ virtual void Copy(TObject &d) const;
+ virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
- TArrayI *GetArray() const {return fIndex;} // Get the tarrayi pointer for god knows what reason
+ virtual void Reset();
+ virtual void ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime);
+ virtual void ResetContent();
+ virtual void ResetCounters();
+ virtual void ResetTbinCounter() { fPositionTbin = 1; }
- virtual Int_t GetNrow() const {return fNrows;} // Get Nrows
- virtual Int_t GetNcol() const {return fNcols;} // Get Ncols
- virtual Int_t GetNtime() const {return fNtbins;} // Get Ntbins
+ virtual void AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
- //enum { kMaxRows = 16, kMaxTbins = 24, kMaxCols = 144};
+ // Get the next pad (row and column) and return kTRUE on success
+ Bool_t NextRCIndex(Int_t &row, Int_t &col);
+ // Get the next timebin of a pad (row and column) and return kTRUE on success
+ Bool_t NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin);
+ // Get the next active timebin and return kTRUE on success
+ Bool_t NextTbinIndex(Int_t &tbin);
- private:
+ Int_t GetCurrentRow() const { return (*fIndex)[fPositionRow]; }
+ Int_t GetCurrentCol() const { return (*fIndex)[fPositionCol]; }
+ Int_t GetCurrentTbin() const { return (*fIndex)[fPositionCol + fPositionTbin]; }
+
+ // Clear the array, actually destroy and recreate w/o allocating
+ void ClearAll();
+ // Return kTRUE if array allocated and there is no need to call allocate
+ Bool_t IsAllocated() const { if (!fIndex) return kFALSE;
+ if (fIndex->GetSize() <= 0) return kFALSE;
+ else return kTRUE; }
+
+ void SetSM(Int_t ix) { fSM = ix; }
+ void SetStack(Int_t ix) { fStack = ix; }
+ void SetChamber(Int_t ix) { SetStack(ix); }
+ void SetLayer(Int_t ix) { fLayer = ix; }
+ void SetPlane(Int_t ix) { SetLayer(ix); }
+ void SetDetNumber(Int_t ix) { fDet = ix; }
+
+ virtual Int_t GetDetNumber() const { return fDet; } // Get Det number
+ virtual Int_t GetLayer() const { return fLayer; } // Layer = Plane = position of the chamber in TRD
+ virtual Int_t GetPlane() const { return fLayer; } // Layer = Plane = position of the chamber in TRD
+ virtual Int_t GetStack() const { return fStack; } // Stack = Chameber = position of the chamber in TRD
+ virtual Int_t GetChamber() const { return fStack; } // Stack = Chameber = position of the chamber in TRD
+ virtual Int_t GetSM() const { return fSM; } // Super module of the TRD
+ TArrayI *GetArray() const { return fIndex; } // Get the tarrayi pointer for god knows what reason
- Int_t fDet; // det number
- Int_t fLayer; // aka plane - position in the full TRD
- Int_t fStack; // aka chamber - position in the full TRD
- Int_t fSM; // super module - position in the full TRD
+ virtual Bool_t HasEntry() const { return fHasEntry; } // Return status if has an entry
- protected:
+ virtual Int_t GetNrow() const { return fNrows; } // Get Nrows
+ virtual Int_t GetNcol() const { return fNcols; } // Get Ncols
+ virtual Int_t GetNtime() const { return fNtbins; } // Get Ntbins
- TArrayI *fIndex; //! monitor active pads and tbins
+ private:
- Int_t fPositionRow; // position in the index - jumps by 1 + 1 + fNtbins
- Int_t fPositionCol; // position in the index - jumps by 1 + 1 + fNtbins
- Int_t fPositionTbin; // position in the tbin - goes from 0 to fNtbins
+ Int_t fDet; // Detector number
+ Int_t fLayer; // Aka plane - position in the full TRD
+ Int_t fStack; // Aka chamber - position in the full TRD
+ Int_t fSM; // Super module - position in the full TRD
- Int_t fLastRow; // to keep track what is the RC combination
- Int_t fLastCol; // to keep track what is the RC combination
- Int_t fLastTbin; // to keep track what is the Tbin - will catch if raw data bogus
+ TArrayI *fIndex; //! Monitor active pads and tbins
- Int_t fNrows; // number of rows in the chamber
- Int_t fNcols; // number of cols in the chamber
- Int_t fNtbins; // number of tbins in the chamber
+ Int_t fPositionRow; // Position in the index - jumps by 1 + 1 + fNtbins
+ Int_t fPositionCol; // Position in the index - jumps by 1 + 1 + fNtbins
+ Int_t fPositionTbin; // Position in the tbin - goes from 0 to fNtbins
- Int_t fMaxLimit; // max number of things in the array = nrow * ncol * ntime + nrow * ncol * 2
+ Int_t fLastRow; // To keep track what is the RC combination
+ Int_t fLastCol; // To keep track what is the RC combination
+ Int_t fLastTbin; // To keep track what is the Tbin - will catch if raw data bogus
- Bool_t fResetCounters; // reset counter status
+ Int_t fNrows; // Number of rows in the chamber
+ Int_t fNcols; // Number of cols in the chamber
+ Int_t fNtbins; // Number of tbins in the chamber
- Bool_t fHasEntry; // kTRUE flag if we have an entry
+ Int_t fMaxLimit; // Max number of things in the array = nrow*ncol*ntime + nrow*ncol*2
+ Bool_t fResetCounters; // Reset counter status
+ Bool_t fHasEntry; // kTRUE flag if we have an entry
- ClassDef(AliTRDSignalIndex,1) // Data container for one TRD detector segment
+ ClassDef(AliTRDSignalIndex,2) // Data container for one TRD detector segment
};
-
#endif
Int_t sec;
Bool_t isElectron;
- const Int_t maxEle = 1000;
+ const Int_t kMaxEle = 1000;
Int_t electronPlus;
Int_t electronMinus;
- Int_t sectorElePlus[maxEle];
- Int_t sectorEleMinus[maxEle];
- Float_t ptElePlus[maxEle];
- Float_t ptEleMinus[maxEle];
+ Int_t sectorElePlus[kMaxEle];
+ Int_t sectorEleMinus[kMaxEle];
+ Float_t ptElePlus[kMaxEle];
+ Float_t ptEleMinus[kMaxEle];
Int_t hadronLowPt;
Int_t hadronHighPt;
Int_t hadronJetLowPt;
// Implementation of the TRD PID class //
// //
// Assigns the electron and pion likelihoods to each ESD track. //
-// The function MakePID(AliESDEvent *event) calculates the probability //
+// The function MakePID(AliESDEvent *event) calculates the probability //
// of having dedx and a maximum timbin at a given //
// momentum (mom) and particle type k //
// from the precalculated distributions. //
// //
// Authors : //
-// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (Original version)//
-// Alex Bercuci (a.bercuci@gsi.de) //
+// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (orig. version) //
+// Alex Bercuci (a.bercuci@gsi.de) //
// //
////////////////////////////////////////////////////////////////////////////
#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "AliTracker.h"
+#include "AliRun.h"
#include "AliTRDpidESD.h"
#include "AliTRDgeometry.h"
#include "AliTRDcalibDB.h"
-#include "AliRun.h"
#include "AliTRDtrack.h"
#include "Cal/AliTRDCalPID.h"
-
ClassImp(AliTRDpidESD)
- Bool_t AliTRDpidESD::fCheckTrackStatus = kTRUE;
- Bool_t AliTRDpidESD::fCheckKinkStatus = kFALSE;
- Int_t AliTRDpidESD::fMinPlane = 0;
+Bool_t AliTRDpidESD::fgCheckTrackStatus = kTRUE;
+Bool_t AliTRDpidESD::fgCheckKinkStatus = kFALSE;
+Int_t AliTRDpidESD::fgMinPlane = 0;
//_____________________________________________________________________________
AliTRDpidESD::AliTRDpidESD()
- :TObject(), fTrack(0x0)
+ :TObject()
+ ,fTrack(0x0)
{
//
// Default constructor
//_____________________________________________________________________________
AliTRDpidESD::AliTRDpidESD(const AliTRDpidESD &p)
- :TObject(p), fTrack(0x0)
+ :TObject(p)
+ ,fTrack(0x0)
{
//
// AliTRDpidESD copy constructor
//
// Destructor
//
- if(fTrack) delete fTrack;
+
+ if(fTrack) delete fTrack;
+
}
//_____________________________________________________________________________
// Copy function
//
- ((AliTRDpidESD &) p).fCheckTrackStatus = fCheckTrackStatus;
- ((AliTRDpidESD &) p).fCheckKinkStatus = fCheckKinkStatus;
- ((AliTRDpidESD &) p).fMinPlane = fMinPlane;
+ ((AliTRDpidESD &) p).fgCheckTrackStatus = fgCheckTrackStatus;
+ ((AliTRDpidESD &) p).fgCheckKinkStatus = fgCheckKinkStatus;
+ ((AliTRDpidESD &) p).fgMinPlane = fgMinPlane;
((AliTRDpidESD &) p).fTrack = 0x0;
}
//
// Author
// Alex Bercuci (A.Bercuci@gsi.de) 2nd May 2007
+ //
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
mom = 0.;
length = 0.;
nPlanePID = 0;
- for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] = 1./AliPID::kSPECIES;
+ for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++)
+ p[iSpecies] = 1./AliPID::kSPECIES;
+
for (Int_t iPlan = 0; iPlan < AliTRDgeometry::kNplan; iPlan++) {
// read data for track segment
for(int iSlice=0; iSlice<AliTRDtrack::kNslice; iSlice++)
Double_t probTotal = 0.;
for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) probTotal += p[iSpecies];
if(probTotal <= 0.){
- AliWarningGeneral("AliTRDpidESD::MakePID()", Form("The total probability (%e) over all species <= 0 in ESD track %d. This may be caused by some error in reference data. Calculation continue but results might be corrupted.", probTotal, i));
+ AliWarning(Form("The total probability (%e) over all species <= 0 in ESD track %d."
+ , probTotal, i));
+ AliWarning("This may be caused by some error in reference data.");
+ AliWarning("Calculation continues but results might be corrupted.");
continue;
}
for(Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] /= probTotal;
}
return 0;
+
}
//_____________________________________________________________________________
//
// Check the ESD track status
- if (fCheckTrackStatus) {
+ if (fgCheckTrackStatus) {
if (((t->GetStatus() & AliESDtrack::kTRDout ) == 0) &&
((t->GetStatus() & AliESDtrack::kTRDrefit) == 0)) return kFALSE;
}
// Check for ESD kink tracks
- if (fCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE;
+ if (fgCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE;
return kTRUE;
+
}
//_____________________________________________________________________________
-Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd, Int_t plan, Float_t &mom, Float_t &length)
+Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd
+ , Int_t plan
+ , Float_t &mom
+ , Float_t &length)
{
//
// Retrive momentum "mom" and track "length" in TRD chamber from plane
//
// Origin
// Alex Bercuci (A.Bercuci@gsi.de)
+ //
const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.;
const Float_t kDrWidth = AliTRDgeometry::DrThick();
if(TMath::Abs(alpha-param->GetAlpha())>.01) return kFALSE;
return kTRUE;
-}
+}
////////////////////////////////////////////////////////////////////////////
// //
-// Assigns the PID probabilities based on TRD information to the ESDs //
+// Assigns the PID probabilities based on TRD information to the ESDs //
+// //
+// Authors : //
+// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (orig. version) //
+// Alex Bercuci (a.bercuci@gsi.de) //
// //
////////////////////////////////////////////////////////////////////////////
class AliESDEvent;
class AliESDtrack;
class AliExternalTrackParam;
+
class AliTRDpidESD : public TObject {
public:
static Bool_t CheckTrack(AliESDtrack *t);
Int_t MakePID(AliESDEvent *event);
- void SetCheckTrackStatus(Bool_t status = kTRUE) { fCheckTrackStatus = status; };
- void SetCheckKinkStatus(Bool_t status = kTRUE) { fCheckKinkStatus = status; };
- void SetMinPlane(Int_t plane) { fMinPlane = plane; };
+ void SetCheckTrackStatus(Bool_t status = kTRUE) { fgCheckTrackStatus = status; };
+ void SetCheckKinkStatus(Bool_t status = kTRUE) { fgCheckKinkStatus = status; };
+ void SetMinPlane(Int_t plane) { fgMinPlane = plane; };
- Bool_t GetCheckTrackStatus() { return fCheckTrackStatus; };
- Bool_t GetCheckKinkStatus() { return fCheckKinkStatus; };
- Int_t GetMinPlane() { return fMinPlane; };
+ Bool_t GetCheckTrackStatus() const { return fgCheckTrackStatus; };
+ Bool_t GetCheckKinkStatus() const { return fgCheckKinkStatus; };
+ Int_t GetMinPlane() const { return fgMinPlane; };
private:
- Bool_t RecalculateTrackSegmentKine(AliESDtrack *t, Int_t plan, Float_t &mom, Float_t &length);
-private:
+ Bool_t RecalculateTrackSegmentKine(AliESDtrack *t
+ , Int_t plan
+ , Float_t &mom
+ , Float_t &length);
- static Bool_t fCheckTrackStatus; // Enable check on ESD track status
- static Bool_t fCheckKinkStatus; // Enable check on ESD kink track
- static Int_t fMinPlane; // Minimum number of planes
+ static Bool_t fgCheckTrackStatus; // Enable check on ESD track status
+ static Bool_t fgCheckKinkStatus; // Enable check on ESD kink track
+ static Int_t fgMinPlane; // Minimum number of planes
- AliExternalTrackParam *fTrack; //! Memory holder for Track segment calculations
+ AliExternalTrackParam *fTrack; //! Memory holder for Track segment calculations
- ClassDef(AliTRDpidESD,2) // TRD PID class
+ ClassDef(AliTRDpidESD,2) // TRD PID class
};
/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// TRD simulation - multimodule (regular rad.) //
-// after: M. CASTELLANO et al., COMP. PHYS. COMM. 51 (1988) 431 //
-// + COMP. PHYS. COMM. 61 (1990) 395 //
-// //
-// 17.07.1998 - A.Andronic //
-// 08.12.1998 - simplified version //
-// 11.07.2000 - Adapted code to aliroot environment (C.Blume) //
-// 04.06.2004 - Momentum dependent parameters implemented (CBL) //
-// //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// TRD simulation - multimodule (regular rad.) //
+// after: M. CASTELLANO et al., COMP. PHYS. COMM. 51 (1988) 431 //
+// + COMP. PHYS. COMM. 61 (1990) 395 //
+// //
+// 17.07.1998 - A.Andronic //
+// 08.12.1998 - simplified version //
+// 11.07.2000 - Adapted code to aliroot environment (C.Blume) //
+// 04.06.2004 - Momentum dependent parameters implemented (CBL) //
+// //
+////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
}
//_____________________________________________________________________________
-Int_t AliTRDsimTR::SelectNFoils(Float_t p)
+Int_t AliTRDsimTR::SelectNFoils(Float_t p) const
{
//
// Selects the number of foils corresponding to the momentum
virtual Int_t Locate(Double_t *xv, Int_t n, Double_t xval
, Int_t &kl, Double_t &dx);
virtual Double_t Omega(Float_t rho, Float_t z, Float_t a) { return (28.8 * TMath::Sqrt(rho * z / a)); };
- virtual Int_t SelectNFoils(Float_t p);
+ virtual Int_t SelectNFoils(Float_t p) const;
void SetFoilThick(Float_t t) { fFoilThick = t;
SetSigma(); };
AliTRDtransform();
AliTRDtransform(Int_t det);
AliTRDtransform(const AliTRDtransform &t);
- ~AliTRDtransform();
+ virtual ~AliTRDtransform();
AliTRDtransform &operator=(const AliTRDtransform &t) { *(new(this) AliTRDtransform(t));
return *this; }
//_____________________________________________________________________________
void AliTRDtrigger::Init()
{
+ //
+ // Initialization
+ //
fModule = new AliTRDmodule();
fTracks->Clear();