class structure.
#include "AliHLTPHOSRcuHistogramProducer.h"
#include <iostream>
-#include "stdio.h"
-#include <cstdlib>
+//#include "stdio.h"
+#//include <cstdlib>
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
#include "TFile.h"
+using namespace std;
+
+
/*************************************************************************
* Class AliHLTPHOSRcuHistogramProducer accumulating histograms *
* with amplitudes per PHOS channel *
* and it fills the histograms with amplitudes per channel. *
* Usage example see in PHOS/macros/Shuttle/AliPHOSCalibHistoProducer.C *
**************************************************************************/
-AliHLTPHOSRcuHistogramProducer:: AliHLTPHOSRcuHistogramProducer(): fEventCount(0), fEquippmentID(0), fModuleID(0), fRcuX(0), fRcuZ(0)
+
+
+AliHLTPHOSRcuHistogramProducer:: AliHLTPHOSRcuHistogramProducer(): fModuleID(0), fRcuX(0), fRcuZ(0)
+
{
+ //Default constructor
cout << "WARNING: You cannot invoke the AliHLTPHOSRcuHistogramProducer without arguments" << endl;
cout << "Usage AliHLTPHOSRcuHistogramProducer(ModuleID, X. Z)" << endl;
- // Reset();
- // Init();
}
+//AliHLTPHOSRcuHistogramProducer::AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t moduleID, AliHLTUInt8_t rcuX, AliHLTUInt8_t rcuZ)
AliHLTPHOSRcuHistogramProducer::AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t moduleID, AliHLTUInt8_t rcuX, AliHLTUInt8_t rcuZ)
{
+ //Se header file for documentation
SetModuleID(moduleID);
SetRcuX(rcuX);
SetRcuZ(rcuZ);
AliHLTPHOSRcuHistogramProducer::~ AliHLTPHOSRcuHistogramProducer()
{
-
+ //Destructor
}
void
AliHLTPHOSRcuHistogramProducer::Init()
{
+ //See header file for documentation
char tmpHistoName[256];
int geomx;
int geomz;
}
}
-int
-AliHLTPHOSRcuHistogramProducer::GetEquippmentId()
-{
- return fEquippmentID;
-}
-
void
AliHLTPHOSRcuHistogramProducer::SetRcuX(AliHLTUInt8_t X)
{
+ //See header file for documentation
fRcuX = X;
fCellAccEnergy.fRcuX = X;
}
+
void
AliHLTPHOSRcuHistogramProducer::SetRcuZ(AliHLTUInt8_t Z)
{
+ //See header file for documentation
fRcuZ = Z;
fCellAccEnergy.fRcuZ = Z;
}
-void
-AliHLTPHOSRcuHistogramProducer::SetModuleID(AliHLTUInt8_t moduleID)
-{
- fModuleID = moduleID;
-}
void
-AliHLTPHOSRcuHistogramProducer::SetEquippmentId(int id)
+AliHLTPHOSRcuHistogramProducer::SetModuleID(AliHLTUInt8_t moduleID)
{
- fEquippmentID = id;
+ //See header file for documentation
+ fModuleID = moduleID;
}
void
AliHLTPHOSRcuHistogramProducer::FillEnergy(AliHLTUInt8_t x, AliHLTUInt8_t z, AliHLTUInt8_t gain, float energy)
{
+ //See header file for documentation
fCellAccEnergy.fAccumulatedEnergies[x][z][gain] += energy;
fCellAccEnergy.fHits[x][z][gain] ++;
fEnergyHistogramPtrs[x][z][gain]->Fill(energy);
void
AliHLTPHOSRcuHistogramProducer::FillTime(AliHLTUInt8_t x, AliHLTUInt8_t z, AliHLTUInt8_t gain, float time)
{
+ //See header file for documentation
fTimingHistogramPtrs[x][z][gain]->Fill(time);
}
return fCellAccEnergy ;
}
-int
-AliHLTPHOSRcuHistogramProducer::IncrementEventCounter()
-{
- fEventCount ++;
- return fEventCount;
-}
-
void
AliHLTPHOSRcuHistogramProducer::Reset()
{
+ //See header file for documentation
for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
{
for(int z = 0; z < N_ZROWS_RCU; z ++)
}
}
+
void
AliHLTPHOSRcuHistogramProducer::WriteEnergyHistograms()
{
+ //See header file for documentation
char tmpFileName[256];
sprintf(tmpFileName,"/home/aliphoshlt/rundir/outdata/calibHisto_%d_%d_%d.root", (int)fModuleID, (int)fRcuX, (int)fRcuZ);
TFile *histoFile = new TFile(tmpFileName,"update");
#include "AliHLTPHOSDefinitions.h"
#include "AliHLTPHOSCommonDefs.h"
#include "TH1.h"
-//#include "AliHLTPHOSModuleCellAccumulatedEnergyDataStruct.h"
#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
#define XBIN_LOW 0
public:
AliHLTPHOSRcuHistogramProducer();
AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t moduleID, AliHLTUInt8_t rcuX, AliHLTUInt8_t rcuZ);
-
virtual ~AliHLTPHOSRcuHistogramProducer();
- int GetEquippmentId();
const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct& GetCellAccumulatedEnergies();
- int IncrementEventCounter();
void Init();
- void SetEquippmentId(int id);
void SetRcuX(AliHLTUInt8_t X);
void SetRcuZ(AliHLTUInt8_t Z);
void SetModuleID(AliHLTUInt8_t moduleID);
void Reset();
void WriteEnergyHistograms();
-
protected:
private:
return *this;
};
- TH1F *fEnergyHistogramPtrs[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
- TH1F *fTimingHistogramPtrs[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
+ TH1F *fEnergyHistogramPtrs[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; /**<Array to store energy distribution per channel for one rcu*/
+ TH1F *fTimingHistogramPtrs[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; /**<Array to store timing distribution per channel for one rcu*/
- Float_t fEnergyAverageValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
- Double_t fAccumulatedValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
- Float_t fTimingAverageValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
+ Float_t fEnergyAverageValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; /**<Accumulated energy divided by hits*/
+ Double_t fAccumulatedValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; /**<Array to store accumulated energy per channel for one rcu during run*/
+ Float_t fTimingAverageValues[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; /**<Avereage TOF*/
AliHLTUInt32_t fHits[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS];
- int fEventCount;
- AliHLTUInt32_t fEquippmentID;
- Double_t fTmpChannelData[ALTRO_MAX_SAMPLES];
- // AliHLTPHOSModuleCellAccumulatedEnergyDataStruct* fOutPtr;
+ Double_t fTmpChannelData[ALTRO_MAX_SAMPLES]; /**<temporary variable to store raw samples from a single altro channel*/
AliHLTPHOSRcuCellAccumulatedEnergyDataStruct fCellAccEnergy;
- // AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fOutPtr;
- AliHLTUInt8_t fModuleID;
- AliHLTUInt8_t fRcuX;
- AliHLTUInt8_t fRcuZ;
+ AliHLTUInt8_t fModuleID; /**<ID of the module this component read data from (0-4)*/
+ AliHLTUInt8_t fRcuX; /**<X position of RCU the data from this Equippment comes from (0 or 1)*/
+ AliHLTUInt8_t fRcuZ; /**<Z position of RCU the data from this Equippment comes from (0 or 1)*/
};
#endif
**************************************************************************/
#include <iostream>
-#include "stdio.h"
-#include <cstdlib>
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-//#include "AliHLTPHOSModuleCellAccumulatedEnergyDataStruct.h"
#include "AliHLTPHOSRcuHistogramProducer.h"
#include "AliHLTPHOSRcuHistogramProducerComponent.h"
+#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
+//const AliHLTComponentDataType AliHLTPHOSRcuHistogramProducerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
+//const AliHLTComponentDataType AliHLTPHOSRcuHistogramProducerComponent::fgkOutputDataType=kAliHLTVoidDataType;
-const AliHLTComponentDataType AliHLTPHOSRcuHistogramProducerComponent::inputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
-const AliHLTComponentDataType AliHLTPHOSRcuHistogramProducerComponent::outputDataType=kAliHLTVoidDataType;
AliHLTPHOSRcuHistogramProducerComponent gAliHLTPHOSRcuHistogramProducerComponent;
-//AliHLTPHOSHistogramProducerComponent gAliHLTPHOSHistogramProducerComponent;
+
+
/*************************************************************************
* Class AliHLTPHOSRcuHistogramProducerComponent accumulating histograms *
* with amplitudes per PHOS channel *
* and it fills the histograms with amplitudes per channel. *
* Usage example see in PHOS/macros/Shuttle/AliPHOSCalibHistoProducer.C *
**************************************************************************/
-AliHLTPHOSRcuHistogramProducerComponent:: AliHLTPHOSRcuHistogramProducerComponent():AliHLTProcessor(), fEventCount(0), fRcuHistoProducerPtr(0)
+AliHLTPHOSRcuHistogramProducerComponent:: AliHLTPHOSRcuHistogramProducerComponent():AliHLTPHOSProcessor(), fRcuHistoProducerPtr(0)
{
- // Reset();
+ //Default constructor
}
-
AliHLTPHOSRcuHistogramProducerComponent::~ AliHLTPHOSRcuHistogramProducerComponent()
{
-
+ //Destructor
}
-AliHLTPHOSRcuHistogramProducerComponent::AliHLTPHOSRcuHistogramProducerComponent(const AliHLTPHOSRcuHistogramProducerComponent & ) : AliHLTProcessor(), fEventCount(0), fRcuHistoProducerPtr(0)
+AliHLTPHOSRcuHistogramProducerComponent::AliHLTPHOSRcuHistogramProducerComponent(const AliHLTPHOSRcuHistogramProducerComponent & ) : AliHLTPHOSProcessor(), fRcuHistoProducerPtr(0)
{
}
int
AliHLTPHOSRcuHistogramProducerComponent::Deinit()
{
+ //See html documentation of base class
cout << "AliHLTPHOSRcuHistogramProducerComponent::Deinit()" << endl;
fRcuHistoProducerPtr->WriteEnergyHistograms();
return 0;
}
-int
-AliHLTPHOSRcuHistogramProducerComponent::DoDeinit()
-{
- Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSRcuHistogramProducer DoDeinit");
- return 0;
-}
-
-
const char*
AliHLTPHOSRcuHistogramProducerComponent::GetComponentID()
{
+ //See html documentation of base class
return "RcuHistogramProducer";
}
void
- AliHLTPHOSRcuHistogramProducerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+AliHLTPHOSRcuHistogramProducerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
{
- const AliHLTComponentDataType* pType=inputDataTypes;
+ //See html documentation of base class
+ const AliHLTComponentDataType* pType=fgkInputDataTypes;
while (pType->fID!=0)
{
list.push_back(*pType);
AliHLTComponentDataType
AliHLTPHOSRcuHistogramProducerComponent::GetOutputDataType()
{
+ //See html documentation of base class
return AliHLTPHOSDefinitions::fgkCellEnergyDataType;
}
void
AliHLTPHOSRcuHistogramProducerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
{
+ //See html documentation of base class
constBase = 30;
inputMultiplier = 1;
}
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
{
+ //See html documentation of base class
unsigned long ndx = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
const AliHLTComponentBlockData* iter = NULL;
AliHLTPHOSRcuCellEnergyDataStruct *cellDataPtr;
AliHLTUInt8_t* outBPtr;
-
- // outBPtr = outputPtr;
- // fOutPtr = (AliHLTPHOSRcuCellAccumulatedEnergyDataStruct*)outBPtr;
int tmpCnt;
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
return EMSGSIZE;
}
- fEventCount++;
+ fPhosEventCount++;
return 0;
+
}//end DoEvent
int
AliHLTPHOSRcuHistogramProducerComponent::DoInit( int argc, const char** argv )
{
+ //See html documentation of base class
+ fPrintInfo = kFALSE;
int iResult=0;
TString argument="";
- // fRcuHistoProducerPtr = new AliHLTPHOSRcuHistogramProducer();
- AliHLTUInt8_t tmpRcuX;
- AliHLTUInt8_t tmpRcuZ;
- AliHLTUInt8_t tmpModuleID;
- Bool_t isSetEquippmentID = kFALSE;
-
- for(int i=0; i<argc && iResult>=0; i++)
- {
- argument=argv[i];
-
- if (argument.IsNull())
- {
- continue;
- }
- if (argument.CompareTo("-equipmentID") == 0)
- {
- if(i+1 <= argc)
- {
- fEquippmentID = atoi(argv[i+1]);
- isSetEquippmentID = kTRUE;
- }
- else
- {
- iResult= -1;
- Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )", "Missing argument",
- "The argument -equippmentID expects a number");
- return iResult;
- }
- }
-
- int rcuIndex = (fEquippmentID - 1792)%N_RCUS_PER_MODULE;
- // fModuleID = (fEquippmentID -1792 -rcuIndex)/N_RCUS_PER_MODULE;
- tmpModuleID = ((fEquippmentID -1792 -rcuIndex)/N_RCUS_PER_MODULE);
- SetModuleID(tmpModuleID);
-
- if(rcuIndex == 0)
- {
- tmpRcuX = 0;
- tmpRcuZ = 0;
- }
-
- if(rcuIndex == 1)
- {
- tmpRcuX = 0;
- tmpRcuZ = 1;
- }
-
- if(rcuIndex == 2)
- {
- tmpRcuX = 1;
- tmpRcuZ = 0;
- }
-
- if(rcuIndex == 3)
- {
- tmpRcuX = 1;
- tmpRcuZ = 1;
- }
+ iResult = ScanArguments(argc, argv);
- SetRcuX(tmpRcuX);
- SetRcuZ(tmpRcuZ);
- cout <<"********InitInfo************"<< endl;
- cout <<"AliHLTPHOSRcuHistogramProducerComponent::SetCoordinate"<< endl;
- cout <<"Equpippment ID =\t"<< fEquippmentID <<endl;
- cout <<"Module ID =\t"<< (int) tmpModuleID<<endl;
- cout <<"RCUX =\t\t" << (int)tmpRcuX << endl;
- cout <<"RCUZ =\t\t" << (int)tmpRcuZ << endl;
- }
-
- if(isSetEquippmentID == kFALSE)
+ if(fIsSetEquippmentID == kFALSE)
{
- Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )", "Missing argument",
- "The argument equippmentID is not set: set it with a component argumet like this: -equippmentID <number>");
- iResult = -2;
+ Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )", "Missing argument",
+ "The argument equippmentID is not set: set it with a component argumet like this: -equippmentID <number>");
+ iResult = -2;
}
+ fRcuHistoProducerPtr = new AliHLTPHOSRcuHistogramProducer( fModuleID, fRcuX, fRcuZ);
+ return iResult;
- fRcuHistoProducerPtr = new AliHLTPHOSRcuHistogramProducer( tmpModuleID, tmpRcuX, tmpRcuZ);
-
-
- return iResult;
-}
-
-
-void
-AliHLTPHOSRcuHistogramProducerComponent::SetRcuX(AliHLTUInt8_t X)
-{
- fRcuX = X;
-}
-
-
-void
-AliHLTPHOSRcuHistogramProducerComponent::SetRcuZ(AliHLTUInt8_t Z)
-{
- fRcuZ = Z;
-}
-
-
-void
-AliHLTPHOSRcuHistogramProducerComponent::SetModuleID(AliHLTUInt8_t moduleID)
-{
- fModuleID = moduleID;
-}
-
-
-void
-AliHLTPHOSRcuHistogramProducerComponent::SetEquippmentId(int id)
-{
- fEquippmentID = id;
- fRcuHistoProducerPtr->SetEquippmentId(id);
-}
-
-
-int
-AliHLTPHOSRcuHistogramProducerComponent::GetEquippmentId()
-{
- return fEquippmentID;
}
AliHLTComponent*
AliHLTPHOSRcuHistogramProducerComponent::Spawn()
{
+ //See html documentation of base class
return new AliHLTPHOSRcuHistogramProducerComponent;
}
/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-#include "AliHLTProcessor.h"
+#include "AliHLTPHOSProcessor.h"
#include "AliHLTPHOSDefinitions.h"
#include "AliHLTPHOSCommonDefs.h"
-//#include "AliHLTPHOSModuleCellAccumulatedEnergyDataStruct.h"
-#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
+//#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
#include "Rtypes.h"
+
class AliHLTPHOSRcuHistogramProducer;
+class AliHLTPHOSRcuCellAccumulatedEnergyDataStruct;
-class AliHLTPHOSRcuHistogramProducerComponent:public AliHLTProcessor
+class AliHLTPHOSRcuHistogramProducerComponent:public AliHLTPHOSProcessor
{
public:
AliHLTPHOSRcuHistogramProducerComponent();
virtual ~AliHLTPHOSRcuHistogramProducerComponent();
virtual int DoInit( int argc, const char** argv );
virtual int Deinit();
- virtual int DoDeinit();
- // virtual int DoEvent(const AliHLTComponentEventData&, const AliHLTComponentBlockData*, AliHLTComponentTriggerData&, AliHLTUInt8_t*,
- // AliHLTUInt32_t&, std::vector<AliHLTComponentBlockData, std::allocator<AliHLTComponentBlockData> >&);
virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
-
- // virtual void GetInputDataTypes(std::vector<AliHLTComponentDataType, std::allocator<AliHLTComponentDataType> >&);
virtual void GetInputDataTypes( std::vector <AliHLTComponentDataType>&);
-
virtual AliHLTComponentDataType GetOutputDataType();
virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
virtual AliHLTComponent* Spawn();
-
virtual const char* GetComponentID();
- int GetEquippmentId();
- void SetRcuX(AliHLTUInt8_t X);
- void SetRcuZ(AliHLTUInt8_t Z);
- void SetModuleID(AliHLTUInt8_t moduleID);
- void SetEquippmentId(int id);
-
private:
AliHLTPHOSRcuHistogramProducerComponent(const AliHLTPHOSRcuHistogramProducerComponent & );
{
return *this;
};
- int fEventCount;
- AliHLTUInt8_t fRcuX;
- AliHLTUInt8_t fRcuZ;
- AliHLTUInt8_t fModuleID;
- AliHLTPHOSRcuHistogramProducer* fRcuHistoProducerPtr;
- AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fOutPtr;
-
- // AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fInnPtr;
- // AliHLTPHOSRcuCellAccumulatedEnergyDataStruct& fInnPtr;
-
- static const AliHLTComponentDataType inputDataTypes[];
- static const AliHLTComponentDataType outputDataType;
- int fEquippmentID;
+ AliHLTPHOSRcuHistogramProducer* fRcuHistoProducerPtr; /**<Pointer to a phos histoproducer object*/
+ AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fOutPtr; /**<Pointer to outputbuffer to write results from the component into shared memory*/
+ // static const AliHLTComponentDataType fgkIinputDataTypes[];
+ // static const AliHLTComponentDataType fgkOutputDataType; /**<List of datatypes that can be given to this component*/
};
#endif