#include "AliHLTPHOSBaseline.h"
#include "AliHLTPHOSConstants.h"
+/**
+ * Baseline class for PHOS HLT
+ *
+ * @file AliHLTPHOSBaseline.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Baseline class for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
ClassImp(AliHLTPHOSBaseline);
AliHLTPHOSBaseline::AliHLTPHOSBaseline() :
fGain(-1),
fEntries(0)
{
+ //See header file for documentation
}
AliHLTPHOSBaseline::~AliHLTPHOSBaseline()
{
+ //See header file for documentation
}
-
-
#ifndef ALIHLTPHOSBASELINE_H
#define ALIHLTPHOSBASELINE_H
+/**
+ * Baseline class for PHOS HLT
+ *
+ * @file AliHLTPHOSBaseline.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Baseline class for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "TObject.h"
#include "AliHLTPHOSConstants.h"
using namespace PhosHLTConst;
/**
- @author Øystein Djuvsland <oystein.djuvsland@gmail.com>
+ * @class AliHLTPHOSBaseline
+ * Baseline class for PHOS HLT, used for writing to ROOT files
+ *
+ * @ingroup alihlt_phos
*/
class AliHLTPHOSBaseline : public TObject
{
virtual ~AliHLTPHOSBaseline();
/**
- *
- * @param baseline
+ * Set the baseline
+ * @param baseline is the baseline
*/
void SetBaseline(Float_t baseline) { fBaseline = baseline; }
+
+ /**
+ * Set the x coordinate
+ * @param x is the x coordinate
+ */
void SetX(Int_t x) { fX = x; }
+
+ /**
+ * Set the z coordinate
+ * @param z is the z coordinate
+ */
void SetZ(Int_t z) { fZ = z; }
+
+ /**
+ * Set the gain
+ * @param gain is the gain
+ */
void SetGain(Int_t gain) { fGain = gain; }
- void SetEntries(Int_t /*entries*/) { fEntries = 0; } //TODO: should we not set fEntries to entries? is this a bug?
+
+ /**
+ * Set the number of entries
+ * @param entries is the entries
+ */
+ void SetEntries(Int_t entries) { fEntries = entries; }
+
+ /**
+ * Get the baseline
+ * @return the baseline
+ */
Float_t GetBaseline() { return fBaseline; }
+
+ /**
+ * Get the x
+ * @return the x
+ */
Int_t GetX() { return fX; }
+
+ /**
+ * Get the z
+ * @return the z
+ */
Int_t GetZ() { return fZ; }
+
+ /**
+ * Get the gain
+ * @return the gain
+ */
Int_t GetGain() { return fGain; }
+
+ /**
+ * Get the number of entries
+ * @return the number of entries
+ */
Int_t GetEntries() { return fEntries; }
private:
- Float_t fBaseline;
- Int_t fX;
- Int_t fZ;
- Int_t fGain;
- Int_t fEntries;
+ /** The baseline */
+ Float_t fBaseline; //COMMENT
+
+ /** The x coordinate */
+ Int_t fX; //COMMENT
+
+ /** The z coordinate */
+ Int_t fZ; //COMMENT
+
+ /** The gain */
+ Int_t fGain; //COMMENT
+
+ /** The number of entries */
+ Int_t fEntries; //COMMENT
ClassDef(AliHLTPHOSBaseline, 1);
* provided "as is" without express or implied warranty. *
**************************************************************************/
+
+/**
+ * Measures the baselines and calculates relevant values
+ *
+ * @file AliHLTPHOSBaselineAnalyzer.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Baseline analyzer for PHOS HLT
+ */
+
#include "AliHLTPHOSBaselineAnalyzer.h"
#include "AliHLTPHOSBase.h"
#include "AliHLTPHOSBaseline.h"
fTreePtr(0),
fSanityInspector(0)
{
- //comment
+ //see headerfile for documentation
fSanityInspector = new AliHLTPHOSSanityInspector();
char histName[128];
AliHLTPHOSBaselineAnalyzer::~AliHLTPHOSBaselineAnalyzer()
{
- //comment
+ //see headerfile for documentation
}
void
AliHLTPHOSBaselineAnalyzer::CalculateRcuBaselines(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
{
- //comment
+ //see headerfile for documentation
Int_t xOff = rcuData->fRcuX * N_XCOLUMNS_RCU;
Int_t zOff = rcuData->fRcuZ * N_ZROWS_RCU;
Float_t baseline = 0;
Float_t
AliHLTPHOSBaselineAnalyzer::CalculateChannelBaseline(AliHLTPHOSValidCellDataStruct *cellData, Int_t xOff, Int_t zOff)
{
- //comment
+ //see headerfile for documentation
Int_t crazyness = 0;
Int_t total = 0;
Int_t *data = cellData->fData;
void
AliHLTPHOSBaselineAnalyzer::CalculateAccumulatedChannelBaseline(Int_t x, Int_t z, Int_t gain, Float_t baseline)
{
- //comment
+ //see headerfile for documentation
Float_t oldBaseline = fAccumulatedBaselines[x][z][gain][0];
Float_t nEntries = fAccumulatedBaselines[x][z][gain][1];
void
AliHLTPHOSBaselineAnalyzer::CalculateChannelsBaselineRMS()
{
- //comment
+
+ //see headerfile for documentation
for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
{
for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
void
AliHLTPHOSBaselineAnalyzer::SetRootObjects(TTree *tree, TClonesArray *baselineArray)
{
- //comment
+ //see headerfile for documentation
fTreePtr = tree;
fBaselineArrayPtr = baselineArray;
tree->Branch("Baselines", &fBaselineArrayPtr);
void
AliHLTPHOSBaselineAnalyzer::FillTree()
{
- //comment
+ //see headerfile for documentation
AliHLTPHOSBaseline *baseline;
Int_t n = 0;
void
AliHLTPHOSBaselineAnalyzer::WriteAccumulatedBaselines(const Char_t* filename)
{
- //comment
+ //see headerfile for documentation
TFile *baselineFile = TFile::Open(filename, "recreate");
fTreePtr->Write();
baselineFile->Close();
void
AliHLTPHOSBaselineAnalyzer::WriteChannelHistograms(const Char_t* filename)
{
- //comment
+ //see headerfile for documentation
TFile *file = TFile::Open(filename, "recreate");
for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
void
AliHLTPHOSBaselineAnalyzer::WriteRMSHistogram(const Char_t* filename)
{
- //comment
+ //see headerfile for documentation
TFile *file = TFile::Open(filename, "recreate");
fRMSHistogramPtr->Write();
fRMSMapHighGainHistogramPtr->Write();
void
AliHLTPHOSBaselineAnalyzer::ResetBaselines()
{
- //comment
+ //see headerfile for documentation
for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
{
for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
void
AliHLTPHOSBaselineAnalyzer::ResetChannelCount()
{
- //comment
+ //see headerfile for documentation
fChannelCount = 0;
}
void
AliHLTPHOSBaselineAnalyzer::SetMaxCrazyDifference(Int_t diff)
{
- //comment
+ //see headerfile for documentation
fMaxCrazyDifference = diff;
fSanityInspector->SetMaxDifference(diff);
}
#ifndef ALIHLTPHOSBASELINEANALYZER_H
#define ALIHLTPHOSBASELINEANALYZER_H
+/**
+ * Measures the baselines and calculates relevant values
+ *
+ * @file AliHLTPHOSBaselineAnalyzer.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Baseline analyzer for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSConstants.h"
#include "AliHLTPHOSBase.h"
using namespace PhosHLTConst;
+
+/**
+ * @class AliHLTPHOSBaselineAnalyzer
+ * Measures the baseline in a baseline run. It also calculates
+ * RMS of the signal noise in each channel. It takes as input raw signals,
+ * and outputs an object of AliHLTPHOSBaseline class for each channel.
+ * It also creates several histograms for each channel.
+ *
+ * @ingroup alihlt_phos
+ */
+
class AliHLTPHOSBaselineAnalyzer : public AliHLTPHOSBase
{
public:
+
+ /** Constructor */
AliHLTPHOSBaselineAnalyzer();
+ /** Destructor */
virtual ~AliHLTPHOSBaselineAnalyzer();
+ /**
+ * Calculate baselines for an RCU
+ * @param rcuData is a pointer to energy and timing data from an RCU
+ */
void CalculateRcuBaselines(AliHLTPHOSRcuCellEnergyDataStruct* rcuData);
+
+ /**
+ * Calculate the baseline of channels
+ * @param cellData is a pointer to a valid channel
+ * @param xOff is the offset in the x position given by the RCU number
+ * @param zOff is the offset in the z position given by the RCU number
+ * @return the baseline
+ */
Float_t CalculateChannelBaseline(AliHLTPHOSValidCellDataStruct *cellData, Int_t xOff, Int_t zOff);
+
+ /**
+ * Calculate the accumulated baseline of a channel
+ * @param x is the x coord of the channel
+ * @param z is the z coord of the channel
+ * @param gain is the gain of the channel
+ * @param baseline is the most recent measured baseline
+ */
void CalculateAccumulatedChannelBaseline(Int_t x, Int_t z, Int_t gain, Float_t baseline);
+
+ /**
+ * Calculate the channels baseline RMS
+ */
void CalculateChannelsBaselineRMS();
+
+
// void CalculateAccumulatedBaselines();
+
+ /** Set the ROOT objects to be filled */
void SetRootObjects(TTree *tree, TClonesArray *array);
+
+ /** Fill the tree */
void FillTree();
+ /** Write the accumulated baselines */
void WriteAccumulatedBaselines(const Char_t* filename);
+
+ /** Write the channel histograms */
void WriteChannelHistograms(const Char_t* filename);
+
+ /** Write the RMS histograms */
void WriteRMSHistogram(const Char_t* filename);
+
+ /** Reset the baseline array */
void ResetBaselines();
+
+ /** Reset the channel count */
void ResetChannelCount();
+
+ /** Reset the accumulated baseline array */
void ResetAccumulatedBaselines();
+
+ /** Set the number of samples to be used for the baseline calculation */
void SetNumberOfSamples(Int_t nSamples) { fNSamples = nSamples; }
+
+ /** Set the max difference between 2 samples before flagging crazy */
void SetMaxCrazyDifference(Int_t diff);
+
+ /** Set the maximum signal before flagging that a real signal is in the samples */
void SetMaxSignal(Int_t max) { fMaxSignal = max; }
// void SetChannelsHistograms(TH1F *channelLowGainHistArray[N_XCOLUMNS_MOD][N_ZROWS_MOD], TH1F *channelLowGainHistArray[N_XCOLUMNS_MOD][N_ZROWS_MOD]);
private:
- Int_t fSampleStart; //comment
- Int_t fMaxCrazyDifference; //comment
- Int_t fMaxSignal; //comment
- Int_t fChannelCount; //comment
- Float_t fBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //comment
- Float_t fAccumulatedBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS][2]; //comment
- TTree *fTreePtr; //comment
- TClonesArray *fBaselineArrayPtr; //comment
+
+ /** At which time index to start the measuring of the baseline */
+ Int_t fSampleStart;
+
+ /** Not used anymore */
+ Int_t fMaxCrazyDifference;
+
+ /** Maximum signal level, used to not count channels with signals for baseline measurement */
+ Int_t fMaxSignal;
+
+ /** Count of channels, not used anymore */
+ Int_t fChannelCount;
+
+ /** Array containing the baselines of all channels */
+ Float_t fBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
+
+ /** Array containing the accumulated baselines for all channels */
+ Float_t fAccumulatedBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS][2];
+
+ /** Pointer to a tree containing TClonesArray of AliHLTPHOSBaseline objects */
+ TTree *fTreePtr; //! transient
+
+ /** Pointer to an array of AliHLTPHOSBaseline objects */
+ TClonesArray *fBaselineArrayPtr; //! transient
+
+
// TH1F *fChannelLowGainHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD]; //comment
// TH1F *fChannelHighGainHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD]; //comment
- TH1F *fChannelHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //comment
- TH1F *fFixedChannelHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //comment
- TH1F *fRMSHistogramPtr; //comment
- TH2F *fRMSMapHighGainHistogramPtr; //comment
- TH2F *fRMSMapLowGainHistogramPtr; //comment
- TH1F *fFixedRMSHistogramPtr; //comment
- TH2F *fFixedRMSMapHighGainHistogramPtr; //comment
- TH2F *fFixedRMSMapLowGainHistogramPtr; //comment
- AliHLTPHOSSanityInspector *fSanityInspector; //comment
+
+
+ /** Pointer to an array of histograms containg the baselines */
+ TH1F *fChannelHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //! transient
+
+ /** Pointer to an array of histograms containg the "fixed" baselines */
+ TH1F *fFixedChannelHistogramsPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //! transient
+
+ /** Pointer to a histograms containing the RMS values for all channels */
+ TH1F *fRMSHistogramPtr; //! transient
+
+ /** Pointer to a 2D histogram of the high gain RMS */
+ TH2F *fRMSMapHighGainHistogramPtr; //! transient
+
+ /** Pointer to a 2D histogram of the low gain RMS */
+ TH2F *fRMSMapLowGainHistogramPtr; //! transient
+
+ /** Pointer to a histogram containing the "fixed" RMS values for all channels */
+ TH1F *fFixedRMSHistogramPtr; //! transient
+
+ /** Pointer to a 2D histogram of the "fixed" high gain channels */
+ TH2F *fFixedRMSMapHighGainHistogramPtr; //! transient
+
+ /** Pointer to a 2D histogram of the "fixed" low gain channels */
+ TH2F *fFixedRMSMapLowGainHistogramPtr; //! transient
+
+ /** Pointer to a sanity inspector */
+ AliHLTPHOSSanityInspector *fSanityInspector; //! transient
ClassDef(AliHLTPHOSBaselineAnalyzer, 1);
};
#include <sys/stat.h>
#include <sys/types.h>
+/**
+ * Class does baseline analysis
+ *
+ * @file AliHLTPHOSBaselineAnalyzerComponent.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A baseline analyzer for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
const AliHLTComponentDataType AliHLTPHOSBaselineAnalyzerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
AliHLTPHOSBaselineAnalyzerComponent gAliHLTPHOSBaselineAnalyzerComponent;
fHistPath(0),
fRunNb(0)
{
- //comment
+ //See header file for documentation
}
AliHLTPHOSBaselineAnalyzerComponent::~AliHLTPHOSBaselineAnalyzerComponent()
{
- //comment
+ //See header file for documentation
}
int
AliHLTPHOSBaselineAnalyzerComponent::Deinit()
{
- //comment
+ //See header file for documentation
fBaselineAnalyzerPtr->CalculateChannelsBaselineRMS();
char filename [50];
cout << "Writing files...";
const char*
AliHLTPHOSBaselineAnalyzerComponent::GetComponentID()
{
- //comment
+ //See header file for documentation
return "PhosBaselineAnalyzer";
}
AliHLTComponentDataType
AliHLTPHOSBaselineAnalyzerComponent::GetOutputDataType()
{
- //comment
+ //See header file for documentation
return AliHLTPHOSDefinitions::fgkAliHLTBaselineDataType;
}
void
AliHLTPHOSBaselineAnalyzerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
{
- //comment
+ //See header file for documentation
constBase = 30;
inputMultiplier = 1;
}
int
AliHLTPHOSBaselineAnalyzerComponent::DoInit(int argc, const char** argv )
{
- //Do initialization sprintf(fFilename, "/tmp/phoshlt/analysis/data/run%d/run%d_digitTree_%d.root", fRunNb,fRunNb,(fEvCnt/fWriteInterval - 1));
+ //See header file for documentation
Bool_t pathSet = false;
Bool_t histPathSet = false;
AliHLTComponent*
AliHLTPHOSBaselineAnalyzerComponent::Spawn()
{
- //comment
+ //See header file for documentation
return new AliHLTPHOSBaselineAnalyzerComponent();
}
void
AliHLTPHOSBaselineAnalyzerComponent::CalculateAll()
{
- //comment
+ //See header file for documentation
cout << "Calculating total baselines... \n";
AliHLTPHOSBaseline *baselineObject = 0;
TChain* chain = new TChain("baselineTree");
#ifndef ALIHLTPHOSBASELINEANALYZERCOMPONENT_H
#define ALIHLTPHOSBASELINEANALYZERCOMPONENT_H
+
+/**
+ * Class does baseline analysis
+ *
+ * @file AliHLTPHOSBaselineAnalyzerComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A baseline analyzer for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSProcessor.h"
class AliHLTPHOSBaselineAnalyzer;
class TTree;
+
+/**
+ * @class AliHLTPHOSBaselineAnalyzerComponent
+ *
+ * Class for running baseline analysis for PHOS in HLT. Takes raw data as input and creates
+ * objects of class AliHLTPHOSBaseline. Also it fills histograms of baselines as well as RMS
+ * of the channels
+ */
+
class AliHLTPHOSBaselineAnalyzerComponent : public AliHLTPHOSProcessor
{
public:
+
+ /** Constructor */
AliHLTPHOSBaselineAnalyzerComponent();
+
+ /** Destructor */
virtual ~AliHLTPHOSBaselineAnalyzerComponent();
+ /** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
+ /** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+ /** interface function, see @ref AliHLTComponent for description */
int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
using AliHLTPHOSProcessor::DoEvent;
+
int DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
private:
+ /** Calculate all values baselines, RMS etc. */
void CalculateAll();
- AliHLTPHOSBaselineAnalyzer *fBaselineAnalyzerPtr; //comment
- TTree *fTreePtr; //comment
- TClonesArray *fBaselineArrayPtr; //comment
- UInt_t fEvCnt; //comment
- UInt_t fWriteInterval; //comment
- UInt_t fFillInterval; //comment
- char *fFilename; //comment
- char* fDirectory; //comment
- char* fHistPath; //comment
- Int_t fRunNb; //comment
- Bool_t fCalculateAll; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
+ /** Pointer to a baseline analyzer */
+ AliHLTPHOSBaselineAnalyzer *fBaselineAnalyzerPtr; //! transient
+
+ /** Pointer the a tree containing the TClonesArrays of AliHLTPHOSBaseline objects */
+ TTree *fTreePtr; //! transient
+
+ /** TClonesArray of AliHLTPHOSBaseline objects */
+ TClonesArray *fBaselineArrayPtr; //! transient
+
+ /** Event count */
+ UInt_t fEvCnt; //COMMENT
+
+ /** Number of events between each writing of files */
+ UInt_t fWriteInterval; //COMMENT
+
+ /** Number of events between each filling of the tree */
+ UInt_t fFillInterval; //COMMENT
+
+ /** The filename base */
+ char *fFilename; //! transient
+
+ /** The directory to write the files */
+ char* fDirectory; //! transient
+
+ /** The path for the histograms */
+ char* fHistPath; //! transient
+
+ /** The run number */
+ Int_t fRunNb; //COMMENT
+
+ /** If every value should be calculated, not only RMS */
+ Bool_t fCalculateAll; //COMMMENT
+
+ /** Interface variable */
+ static const AliHLTComponentDataType fgkInputDataTypes[]; //COMMENT
};
#endif
+++ /dev/null
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#include "AliHLTPHOSChannelCounter.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSValidCellDataStruct.h"
-#include "AliHLTPHOSConstants.h"
-#include "TFile.h"
-#include "TH2F.h"
-#include "TH2D.h"
-
-//ClassImp(AliHLTPHOSChannelCounter);
-
-using namespace PhosHLTConst;
-
-AliHLTPHOSChannelCounter::AliHLTPHOSChannelCounter() :
- AliHLTPHOSBase(),
- // fChannelArrayPtr(0),
- fHistHighGainPtr(0),
- fHistLowGainPtr(0),
- fHistHighRatioPtr(0),
- fHistLowRatioPtr(0)
-{
- //comment
- // fChannelArrayPtr = new UInt_t[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
-
- fHistHighGainPtr = new TH2I("highchannelcount", "High gain channel count",
- 64, 0, 63, 56, 0, 56);
- fHistLowGainPtr = new TH2I("lowchannelcount", "Low gain channel count",
- 64, 0, 63, 56, 0, 56);
- fHistHighRatioPtr = new TH2F("highoutofsync", "High gain channel count divided by number of events",
- 64, 0, 63, 56, 0, 56);
- fHistLowRatioPtr = new TH2F("lowoutofsync", "Low gain channel count divided by number of events",
- 64, 0, 63, 56, 0, 56);
-
- for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
- {
- for(UInt_t gain = 0; gain < 2; gain++)
- {
- fChannelArrayPtr[x][z][gain] = 0;
- }
- }
- }
-}
-
-AliHLTPHOSChannelCounter::~AliHLTPHOSChannelCounter()
-{
-//comment
-}
-
-void
-AliHLTPHOSChannelCounter::CountChannels(AliHLTPHOSRcuCellEnergyDataStruct* channelDataPtr)
-{
- //comment
- Int_t tmp[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
- for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
- {
- for(UInt_t gain = 0; gain < 2; gain++)
- {
- tmp[x][z][gain] = 0;
- }
- }
- }
- for(Int_t i = 0; i < channelDataPtr->fCnt; i++)
- {
- AliHLTPHOSValidCellDataStruct *validDataPtr = &(channelDataPtr->fValidData[i]);
-
- tmp[validDataPtr->fX + channelDataPtr->fRcuX*N_XCOLUMNS_RCU]
- [validDataPtr->fZ + channelDataPtr->fRcuZ*N_ZROWS_RCU]
- [validDataPtr->fGain]++;
- }
- for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
- {
- for(UInt_t gain = 0; gain < N_ZROWS_MOD; gain++)
- {
- if(tmp[x][z][gain] > 1)
- fChannelArrayPtr[x][z][gain] = fChannelArrayPtr[x][z][gain] + 1;
- }
- }
- }
-}
-
-void
-AliHLTPHOSChannelCounter::PrintOutOfSyncChannels(Int_t nEvents)
-{
- //comment
- printf("After %d events:\n", nEvents);
- for(UInt_t x = 0; x < N_XCOLUMNS_MOD; x++)
- //for(UInt_t x = 0; x < 63; x++)
- {
- for(UInt_t z = 0; z < N_ZROWS_MOD; z++)
- //for(UInt_t z = 0; z < 55; z++)
- {
- for(UInt_t gain = 0; gain < N_GAINS; gain++)
- //for(UInt_t gain = 0; gain < 2; gain++)
- {
- printf("x = %d -- z = %d -- gain = %d: %d\n", x, z, gain, (fChannelArrayPtr[x][z][gain]));
- }
- }
- }
- printf("\n");
-}
-
-void
-AliHLTPHOSChannelCounter::FillHistograms(Int_t nEvents)
-{
- //comment
- printf("Filling histograms...");
- //for(Int_t x = 0; x < N_XCOLUMNS_MOD; x++)
- for(Int_t x = 0; x < 63; x++)
- {
- // for(Int_t z = 0; z < N_ZROWS_MOD; z++)
- for(Int_t z = 0; z < 55; z++)
- {
- for(Int_t gain = 0; gain < 2; gain++)
- {
-
- if(gain == 0) //TODO: this line was "if(gain = 0)" I presume that was a bug. Please check.
- {
- fHistHighGainPtr->SetBinContent(x, z, fChannelArrayPtr[x][z][gain]);
- fHistHighRatioPtr->SetBinContent(x, z, fChannelArrayPtr[x][z][gain]/(float)nEvents);
- continue;
- }
-
- fHistLowGainPtr->SetBinContent(x, z, fChannelArrayPtr[x][z][gain]);
- fHistLowRatioPtr->SetBinContent(x, z, fChannelArrayPtr[x][z][gain]/(float)nEvents);
- }
- }
- }
- printf("Done!\n");
-}
-
-void
-AliHLTPHOSChannelCounter::WriteHistograms(const char* filename)
-{
- //comment
- printf("Writing histograms to file...");
-
- TFile *outfile = new TFile(filename,"recreate");
-
- fHistHighGainPtr->Write();
- fHistLowGainPtr->Write();
- fHistHighRatioPtr->Write();
- fHistLowRatioPtr->Write();
-
- outfile->Close();
-
- delete outfile;
- outfile = 0;
- printf("Done!\n");
-}
+++ /dev/null
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-#ifndef ALIHLTPHOSCHANNELCOUNTER_H
-#define ALIHLTPHOSCHANNELCOUNTER_H
-
-#include "AliHLTPHOSBase.h"
-
-class AliHLTPHOSRcuCellEnergyDataStruct;
-class AliHLTPHOSConstants;
-class TH2I;
-class TH2F;
-//class AliHLTPHOSBase;
-
-using namespace PhosHLTConst;
-
-class AliHLTPHOSChannelCounter : public AliHLTPHOSBase
-{
-public:
- AliHLTPHOSChannelCounter();
- virtual ~AliHLTPHOSChannelCounter();
-
- void CountChannels(AliHLTPHOSRcuCellEnergyDataStruct* cellEnergy);
- void PrintOutOfSyncChannels(Int_t nEvents);
- void FillHistograms(Int_t nEvents);
- void WriteHistograms(const char* name);
-
-private:
-
- UInt_t fChannelArrayPtr[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //comment
- TH2I *fHistHighGainPtr; //comment
- TH2I *fHistLowGainPtr; //comment
- TH2F *fHistHighRatioPtr; //comment
- TH2F *fHistLowRatioPtr; //comment
-
- // ClassDef(AliHLTPHOSChannelCounter, 1);
-};
-
-#endif
+++ /dev/null
-#ifndef ALIHLTPHOSCLUSTERDATASTRUCT_H
-#define ALIHLTPHOSCLUSTERDATASTRUCT_H
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Authors: Øystein Djuvsland <oysteind@ift.uib.no> *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-
-#include "Rtypes.h"
-#include "AliHLTDataTypes.h"
-
-struct AliHLTPHOSClusterDataStruct
-{
- Float_t fClusterEnergy;
- Float_t fLocalPositionPtr[2];
- AliHLTUInt8_t fPHOSModule;
-};
-
-#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * @file AliHLTPHOSClusterizer.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Clusterizer for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSClusterizer.h"
#include "AliHLTPHOSBase.h"
}//end
-AliHLTPHOSClusterizer::AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) : AliHLTPHOSBase()
-{
- //Copy constructor, not implemented
-}//end
-
AliHLTPHOSClusterizer::~AliHLTPHOSClusterizer()
{
- //Destructor
+ //See header file for documentation
}
+
void
AliHLTPHOSClusterizer::SetRecoParameters(AliPHOSRecoParamEmc* params)
{
- //comment
+ //see header file for documentation
fEmcClusteringThreshold = params->GetClusteringThreshold();
fEmcMinEnergyThreshold = params->GetMinE();
fLogWeight = params->GetLogWeight();
void
AliHLTPHOSClusterizer::SetOfflineMode(AliPHOSGetter* getter)
{
- //comment
+ //see header file for documentation
fRecPointContainerPtr = new AliHLTPHOSRecPointContainerStruct();
fDigitContainerPtr = new AliHLTPHOSDigitContainerDataStruct();
fGetterPtr = getter;
Int_t
AliHLTPHOSClusterizer::GetEvent(Int_t i)
{
- //comment
+ //see header file for documentation
Int_t coord[4];
fGetterPtr->Event(i, "D");
Int_t
AliHLTPHOSClusterizer::GetNEvents()
{
- //comment
+ //see header file for documentation
if(fOnlineMode)
{
printf("Number of events not available in online mode!\n");
Int_t
AliHLTPHOSClusterizer::ClusterizeEvent()
{
- //comment
+ //see header file for documentation
Int_t nRecPoints = 0;
UInt_t i = 0;
AliHLTPHOSClusterizer::ScanForNeighbourDigits(Int_t index, AliHLTPHOSRecPointDataStruct* recPoint)
{
- //comment
+ //see header file for documentation
for(UInt_t j = 0; j < fDigitContainerPtr->fNDigits; j++)
{
AliHLTPHOSClusterizer::AreNeighbours(AliHLTPHOSDigitDataStruct* digit1,
AliHLTPHOSDigitDataStruct* digit2)
{
- //comment
- //Int_t coord1[4];
- //Int_t coord2[4];
-
- // fPHOSGeometry->AbsToRelNumbering(digit1->fID, coord1);
- //fPHOSGeometry->AbsToRelNumbering(digit2->fID, coord2);
-
+ //see header file for documentation
if ( (digit1->fModule == digit2->fModule) /*&& (coord1[1]==coord2[1])*/ ) // inside the same PHOS module
{
void
AliHLTPHOSClusterizer::CalculateCenterOfGravity()
{
- //comment
- // Calculates the center of gravity in the local PHOS-module coordinates
+ //see header file for documentation
+
Float_t wtot = 0.;
//Int_t relid[4];
#ifndef ALIHLTPHOSCLUSTERIZER_H
#define ALIHLTPHOSCLUSTERIZER_H
+
+/**
+ * Class does clusterization in for PHOS on an event basis. It is intended
+ * for use in HLT, but can also be used offline
+ *
+ * @file AliHLTPHOSClusterizer.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Clusterizer for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSBase.h"
#include "AliPHOSGetter.h"
class AliPHOSDigit;
class AliPHOSRecoParamEmc;
+/**
+ * @class AliHLTPHOSClusterizer
+ * Clusterizer for PHOS HLT. The clusterizer takes digits as input, either
+ * in the form of a container of AliHLTPHOSDigitDataStruct or a
+ * TClonesArray of AliPHOSDigit through an instance of a AliPHOSGetter
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSClusterizer : public AliHLTPHOSBase
{
public:
+ /** Constructor */
AliHLTPHOSClusterizer();
+ /** Destructor */
virtual ~AliHLTPHOSClusterizer();
+ /*
AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &);
AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
+ */
+ /** Set rec point container */
void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *RecPointContainerPtr)
{ fRecPointContainerPtr = RecPointContainerPtr; }
+ /** Set reco parameters */
void SetRecoParameters(AliPHOSRecoParamEmc* recoPars);
+ /** Set emc clustering threshold */
void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
+
+ /** Set emc min energy threshold */
void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
+
+ /** Set emc time gate */
void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
+
+ /** Set log weight */
void SetLogWeight(Float_t weight) { fLogWeight = weight; }
+ /**
+ * Set offline mode
+ * @param getter pointer to an instance of AliPHOSGetter
+ */
void SetOfflineMode(AliPHOSGetter* getter);
+ /** Starts clusterization of the event */
virtual Int_t ClusterizeEvent();
+
+ /**
+ * Gets an event, for offline mode
+ * @param evtNr event number to get
+ */
virtual Int_t GetEvent(Int_t evtNr);
+ /** Get number of events */
Int_t GetNEvents();
+ /**
+ * For a given digit this digit scans for neighbouring digits which
+ * passes the threshold for inclusion in a rec point. If one is found
+ * it is added to the current rec point
+ * @param digIndex index of the digit in the digit container
+ * @param recPoint pointer to the current rec point
+ */
virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
+
+ /**
+ * Checks if two digits are neighbours
+ * @param d1 first digit
+ * @param d2 second digit
+ */
virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
+
+ /** Calculates the center of gravity of a rec point */
virtual void CalculateCenterOfGravity();
private:
-
- Float_t fEmcClusteringThreshold; //comment
- Float_t fEmcMinEnergyThreshold; //comment
- Float_t fEmcTimeGate; //comment
- Float_t fLogWeight; //comment
- Int_t fDigitsInCluster; //comment
+ /** Energy threshold for starting a cluster for the calorimeter */
+ Float_t fEmcClusteringThreshold; //COMMENT
+
+ /** Energy threshold for including a crystal in a cluster */
+ Float_t fEmcMinEnergyThreshold; //COMMENT
+
+ /** Maximum time difference for inclusion in a rec point */
+ Float_t fEmcTimeGate; //COMMENT
+
+ /** Variable used in calculation of the center of gravity for a rec point */
+ Float_t fLogWeight; //COMMENT
+
+ /** Counts the digits in a rec point */
+ Int_t fDigitsInCluster; //COMMENT
- Bool_t fOnlineMode; //comment
+ /** Online mode flag */
+ Bool_t fOnlineMode; //COMMENT
- TClonesArray *fDigitArrayPtr; //comment
- TObjArray *fEmcRecPointsPtr; //comment
- AliPHOSDigit *fDigitPtr; //comment
+ /** Array of digits from one event, used in offline mode */
+ TClonesArray *fDigitArrayPtr; //! transient
+
+ /** Array of reconstruction points from one event, used in offline mode */
+ TObjArray *fEmcRecPointsPtr; //! transient
+
+ /** Pointer to digit */
+ AliPHOSDigit *fDigitPtr; //! transient
+
+ /** Contains the digits from one event */
+ AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
+
+ /** Contains the reconstruction points from one event */
+ AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr; //! transient
- AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //comment
- AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr; //comment
- AliPHOSGeometry *fPHOSGeometry; //comment
+ /** Instance of the PHOS geometry class */
+ AliPHOSGeometry *fPHOSGeometry; //! transient
- AliPHOSGetter *fGetterPtr; //comment
+ /** Instance of the PHOS getter, used in offline mode */
+ AliPHOSGetter *fGetterPtr; //! transient
ClassDef(AliHLTPHOSClusterizer, 1);
};
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
- * Authors: Ã\98ystein Djuvsland <oysteind@ift.uib.no> *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
//#include "AliHLTPHOSPhysicsDefinitions.h"
//#include "AliHLTPHOSDefinitions.h"
#include "AliHLTPHOSRecPointDataStruct.h"
-#include "AliHLTPHOSClusterDataStruct.h"
-#include "AliHLTPHOSRecPointListDataStruct.h"
+//#include "AliHLTPHOSClusterDataStruct.h"
+//#include "AliHLTPHOSRecPointListDataStruct.h"
#include "AliHLTPHOSDigitContainerDataStruct.h"
-using namespace std;
+/** @file AliHLTPHOSClusterizerComponent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief A clusterizer component for PHOS HLT
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
const AliHLTComponentDataType AliHLTPHOSClusterizerComponent::fgkInputDataTypes[]=
{
kAliHLTVoidDataType,{0,"",""}
//AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): AliHLTPHOSBase(), AliHLTProcessor(), fClusterizerPtr(0), fOutPtr(0),
// fRecPointStructArrayPtr(0), fRecPointListPtr(0)
AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): AliHLTPHOSProcessor(), fClusterizerPtr(0), fOutPtr(0),
- fRecPointStructArrayPtr(0), fRecPointListPtr(0)
+ fRecPointStructArrayPtr(0) //, fRecPointListPtr(0)
{
- //Constructor
+ //See headerfile for documentation
}
AliHLTPHOSClusterizerComponent::~AliHLTPHOSClusterizerComponent()
{
- //Destructor
+ //See headerfile for documentation
if (fClusterizerPtr)
{
delete fClusterizerPtr;
fClusterizerPtr = 0;
}
-
+ /*
if (fRecPointListPtr)
{
delete fRecPointListPtr;
fRecPointListPtr = 0;
}
-
+ */
if (fRecPointStructArrayPtr)
{
for (int i = 0; i < 1000; i++)
int
AliHLTPHOSClusterizerComponent::Deinit()
{
- //Deinitialization
+ //See headerfile for documentation
if (fClusterizerPtr)
{
delete fClusterizerPtr;
fClusterizerPtr = 0;
}
-
+ /*
if (fRecPointListPtr)
{
delete fRecPointListPtr;
fRecPointListPtr = 0;
}
-
+ */
for (int i = 0; i < 1000; i++)
{
// fRecPointStructArrayPtr[i].Del();
return 0;
}
-int
-AliHLTPHOSClusterizerComponent::DoDeinit()
-{
- //Do deinitialization
- Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSClusterizerComponent DoDeinit");
-
- return 0;
-}
-
-
const Char_t*
AliHLTPHOSClusterizerComponent::GetComponentID()
{
- //comment
+ //See headerfile for documentation
+
return "AliHltPhosClusterizer";
}
void
AliHLTPHOSClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
{
- //Get datatypes for input
+ //See headerfile for documentation
+
const AliHLTComponentDataType* pType=fgkInputDataTypes;
while (pType->fID!=0)
{
AliHLTComponentDataType
AliHLTPHOSClusterizerComponent::GetOutputDataType()
{
- // return AliHLTPHOSPhysicsDefinitions::fgkAliHLTClusterDataType;
+ //See headerfile for documentation
+
return AliHLTPHOSDefinitions::fgkAliHLTClusterDataType;
}
AliHLTPHOSClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
{
+ //See headerfile for documentation
+
constBase = 30;
inputMultiplier = 0.2;
}
AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
- //Do event
+ //See headerfile for documentation
UInt_t tSize = 0;
UInt_t offset = 0;
nDigits++;
}
-// nRecPoints = fClusterizerPtr->CreateRecPointStructArray(fRecPointStructArrayPtr, fRecPointListPtr, index);
-
fOutPtr = (AliHLTPHOSRecPointContainerStruct*)outBPtr;
nRecPoints = fClusterizerPtr->ClusterizeEvent();
//nRecPoints = fClusterizerPtr->CalculateCenterOfGravity(&fRecPointStructArrayPtr[i]);
// fClusterizerPtr->CalculateMoments(&fRecPointStructArrayPtr[i], 0);
// fClusterizerPtr->ClusterizeStruct(&fRecPointStructArrayPtr[i], fOutPtr);
- mysize += sizeof(AliHLTPHOSClusterDataStruct);
+ // mysize += sizeof(AliHLTPHOSClusterDataStruct);
+ mysize += sizeof(AliHLTPHOSRecPointDataStruct);
+
AliHLTComponentBlockData bd;
FillBlockData( bd );
int
AliHLTPHOSClusterizerComponent::DoInit(int argc, const char** argv )
{
- //Do initialization
+ //See headerfile for documentation
+
fAllDigitsPtr = new AliHLTPHOSDigitContainerDataStruct();
fClusterizerPtr = new AliHLTPHOSClusterizer();
//fClusterizerPtr->SetNoCrazyness(true);
for (int i = 0; i < argc; i++)
{
/*
- if(!strcmp("-threshold", argv[i]))
+ if(!strcmp("-energythreshold", argv[i]))
fClusterizerPtr->SetThreshold(atof(argv[i+1]));
if(!strcmp("-clusterthreshold", argv[i]))
fClusterizerPtr->SetClusterThreshold(atof(argv[i+1]));
fClusterizerPtr->SetArraySize(atoi(argv[i+1]));*/
}
// fClusterizerPtr->ResetCellEnergyArray();
- fRecPointListPtr = new AliHLTPHOSRecPointListDataStruct[N_ZROWS_MOD*N_XCOLUMNS_MOD];
+
+
fRecPointStructArrayPtr = new AliHLTPHOSRecPointDataStruct[1000];
for (int i = 0; i < 1000; i++)
{
AliHLTComponent*
AliHLTPHOSClusterizerComponent::Spawn()
{
- //Spawn a new AliHLTPHOSClusterizerComponent, for HLT framework
+ //See headerfile for documentation
+
return new AliHLTPHOSClusterizerComponent();
}
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/** @file AliHLTPHOSClusterizerComponent.h
- @author Ã\98ystein Djuvsland
- @date
- @brief A clusterizer component for PHOS HLT
-*/
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
#ifndef ALIHLTPHOSCLUSTERIZERCOMPONENT_H
#define ALIHLTPHOSCLUSTERIZERCOMPONENT_H
-#include "AliHLTPHOSProcessor.h"
+/**
+ * Clusterizer component for PHOS HLT
+ *
+ * @file AliHLTPHOSClusterizerComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A clusterizer component for PHOS HLT
+*/
-//#include "AliHLTPHOSBase.h"
-//#include "AliHLTPHOSDefinitions.h"
-//#include "AliHLTProcessor.h"
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-class AliHLTPHOSClusterizer;
+#include "AliHLTPHOSProcessor.h"
-//class Rtypes;
+class AliHLTPHOSClusterizer;
class AliHLTPHOSRcuCellEnergyDataStruct;
-class AliHLTPHOSClusterDataStruct;
+//class AliHLTPHOSClusterDataStruct;
class AliHLTPHOSRecPointDataStruct;
class AliHLTPHOSRecPointContainerStruct;
class AliHLTPHOSRecPointListDataStruct;
class AliHLTPHOSDigitContainerDataStruct;
-
-
-// PTH class AliHLTPHOSClusterizerComponent: public AliHLTPHOSBase, public AliHLTProcessor
+/**
+ * @class AliHLTPHOSClusterizerComponent
+ *
+ * Class for running clusterization for PHOS in HLT. It takes digits as input and
+ * gives reconstruction points as output.
+ *
+ * The component has the following component arguments:
+ * -clusterthreshold The energy threshold for starting a new rec point
+ * -energythreshold The energy threshold for including a digit in a
+ * rec point
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSClusterizerComponent: public AliHLTPHOSProcessor
-//class AliHLTPHOSClusterizerComponent: public AliHLTPHOSBase, public AliHLTProcessor
{
public:
+ /** Constructor */
AliHLTPHOSClusterizerComponent();
- virtual ~AliHLTPHOSClusterizerComponent();
-
- // AliHLTPHOSClusterizerComponent(const AliHLTPHOSClusterizerComponent &);
- // AliHLTPHOSClusterizerComponent & operator = (const AliHLTPHOSClusterizerComponent &)
- // {
-
- // return *this;
- // }
-
+ /** Destructor */
+ virtual ~AliHLTPHOSClusterizerComponent();
+ /** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
+
+ /** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+ /** interface function, see @ref AliHLTComponent for description */
int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
- // void SetNoCrazyness(Bool_t val);
+protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int Deinit();
+
+ private:
+
+ /** All digits in the event */
+ AliHLTPHOSDigitContainerDataStruct *fAllDigitsPtr; //! transient
- protected:
+ /** Pointer to the clusterizer it self */
+ AliHLTPHOSClusterizer* fClusterizerPtr; //! transient
using AliHLTPHOSProcessor::DoEvent;
- int DoInit(int argc, const char** argv);
- virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
- int DoDeinit();
+ /** Pointer to the output of the component */
+ AliHLTPHOSRecPointContainerStruct* fOutPtr; //! transient
- private:
- AliHLTPHOSDigitContainerDataStruct *fAllDigitsPtr; //comment
- AliHLTPHOSClusterizer* fClusterizerPtr; //Pointer to the clusterizer
- AliHLTPHOSRecPointContainerStruct* fOutPtr; //Pointer to the struct of output clusters
- AliHLTPHOSRecPointDataStruct* fRecPointStructArrayPtr; //Pointer to the struct of output recpoints
- AliHLTPHOSRecPointListDataStruct* fRecPointListPtr; //Pointer to the struct of list of output recpoints
- Int_t fDigitCount; //comment
- Bool_t fNoCrazyness; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
+ /** Pointer to rec points used in clusterization */
+ AliHLTPHOSRecPointDataStruct* fRecPointStructArrayPtr; //! transient
+
+ /** Number of digits in event */
+ Int_t fDigitCount;
+
+ /** If one should consider crazyness or not */
+ Bool_t fNoCrazyness;
+
+ /** interface function, see @ref AliHLTComponent for description */
+ static const AliHLTComponentDataType fgkInputDataTypes[];
};
#endif
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTSpectrumDataType = { sizeof(AliHLTComponentDataType), {'S','P','E','C','T','Y','P','E'},{'P','H','O','S'}};;
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTRootTreeDataType = { sizeof(AliHLTComponentDataType), {'R','T','R','E','T','Y','P','E'},{'P','H','O','S'}};;
const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTBaselineDataType = { sizeof(AliHLTComponentDataType), {'B','A','S','L','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTNoiseMapDataType = { sizeof(AliHLTComponentDataType), {'N','O','M','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTMIPDataType = { sizeof(AliHLTComponentDataType), {'M','I','P','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTSandboxDataType = { sizeof(AliHLTComponentDataType), {'S','B','X','T','Y','P','E'},{'P','H','O','S'}};;
-const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkEmcCalibDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTDigitDataType = { sizeof(AliHLTComponentDataType), {'D','I','G','I','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTNoiseMapDataType = { sizeof(AliHLTComponentDataType), {'N','O','M','A','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTMIPDataType = { sizeof(AliHLTComponentDataType), {'M','I','P','D','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTSandboxDataType = { sizeof(AliHLTComponentDataType), {'S','A','B','X','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkEmcCalibDataType = { sizeof(AliHLTComponentDataType), {'C','A','L','I','T','Y','P','E'},{'P','H','O','S'}};;
+const AliHLTComponentDataType AliHLTPHOSDefinitions::fgkAliHLTRecPointDataType = { sizeof(AliHLTComponentDataType), {'R','E','C','P','T','Y','P','E'},{'P','H','O','S'}};;
static const AliHLTComponentDataType fgkAliHLTNoiseMapDataType; //Noise map data type
static const AliHLTComponentDataType fgkAliHLTSandboxDataType; //General data type
static const AliHLTComponentDataType fgkEmcCalibDataType; //Calibration data type
+ static const AliHLTComponentDataType fgkAliHLTRecPointDataType; //RecPoint datatype
};
#endif
-//insert copyright
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
#include "AliHLTPHOSDigit.h"
#include "AliHLTPHOSAltroConfig.h"
+/**
+ * Digit class for PHOS HLT
+ *
+ * @file AliHLTPHOSDigit.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Digit class for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
ClassImp(AliHLTPHOSDigit);
AliHLTPHOSDigit::AliHLTPHOSDigit() :
fTotalSamples(70),
fDebugVar(-1)
{
+ //See header file for documentation
//added by PT
fSamples = fNSamples;
fPreSamples = fNPresamples;
AliHLTPHOSDigit::~AliHLTPHOSDigit()
{
- //comment
+ //See header file for documentation
}
void
AliHLTPHOSDigit::SetRawData(Int_t *dataPtr)
{
+ // See header file for documentation
//modified by PT
// for(Int_t i = 0; i < 70; i++)
// {
void
AliHLTPHOSDigit::ResetDigit()
{
+ // See header file for documentation
fZ = -1;
fX = -1;
fAmplitude = -1;
-//insert copyright
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
#ifndef ALIHLTPHOSDIGIT_H
#define ALIHLTPHOSDIGIT_H
+/**
+ * Digit class for PHOS HLT
+ *
+ * @file AliHLTPHOSDigit.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Digit class for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "TObject.h"
//#include "AliHLTPHOSAltroConfig.h"
#include "AliHLTPHOSBase.h"
//class AliHLTPHOSDigit : public TObject, public AliHLTPHOSAltroConfig
+
+/**
+ * @class AliHLTPHOSDigit
+ * Digit class for PHOS HLT, used for writing ROOT files
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSDigit : public TObject, public AliHLTPHOSBase
{
public:
+
+ /** Constructor */
AliHLTPHOSDigit();
+
+ /** Destructor */
virtual ~AliHLTPHOSDigit();
+ /** Set x */
void SetX(Int_t x) { fX = x; }
+
+ /** Set z */
void SetZ(Int_t z) { fZ = z; }
-
+ /** Set the amplitude in ADC counts */
void SetAmplitude(Float_t amp) { fAmplitude = amp; }
+
+ /** Set the time in sample counts ? */
void SetTime(Float_t time) { fTime = time; }
+
+ /** Set the energy in GeV */
void SetEnergy(Float_t energy) { fEnergy = energy; }
+
+ /** Set the gain */
void SetGain(Int_t gain) { fGain = gain; }
+ /**
+ * Set the raw data
+ * @param rawData is a pointer to an array of raw data
+ */
void SetRawData(Int_t* rawData);
+ /** Set the crazyness */
void SetCrazyness(Int_t crazyness) { fCrazyness = crazyness; }
+
+ /** Set the baseline value */
void SetBaseline(Float_t baseline) { fBaseline = baseline; }
+ /** Set the number of samples */
void SetSamples(Int_t samples) { fSamples = samples; }
+
+ /** Set the number of pre samples */
void SetPreSamples(Int_t presamples) { fPreSamples = presamples; }
+ /** Reset the digit */
void ResetDigit();
+ /** Set the debug variable */
void SetDebugVar(Int_t val) { fDebugVar = val; }
+ /** Get x */
Int_t GetX() { return fX; }
+
+ /** Get z */
Int_t GetZ() { return fZ; }
+
+ /** Get the amplitude */
Float_t GetAmplitude() { return fAmplitude; }
+
+ /** Get the time */
Float_t GetTime() { return fTime; }
+
+ /** Get the energy */
Float_t GetEnergy() { return fEnergy; }
+
+ /** Get the gain */
Int_t GetGain() { return fGain; }
+ /**
+ * Get the raw data
+ * @return a pointer to an array of raw data
+ */
Int_t* GetRawData() { return fData; }
+ /** Get the crazyness */
Int_t GetCrazyness() {return fCrazyness; }
+
+ /** Get the baseline */
Float_t GetBaseline() { return fBaseline; }
+ /** Get number of samples */
Int_t GetSamples() { return fSamples; }
+
+ /** Get number of pre samples */
Int_t GetPreSamples() { return fPreSamples; }
+
+ /** Get the total number of samples */
Int_t GetTotalSamples(){ return fNTotalSamples;}
+ /** Get the debug variable */
Int_t GetDebugVar() { return fDebugVar; }
private:
- Int_t fX; //comment
- Int_t fZ; //comment
- Float_t fAmplitude; //comment
- Float_t fTime; //comment
- Float_t fEnergy; //comment
- Int_t fGain; //comment
- Int_t fSamples; //comment
- Int_t fPreSamples; //comment
- Int_t fTotalSamples; //comment
+ /** The x coordinate */
+ Int_t fX; //COMMENT
+
+ /** The z coordinate */
+ Int_t fZ; //COMMENT
+
+ /** The amplitude in ADC counts*/
+ Float_t fAmplitude; //COMMENT
+
+ /** The time */
+ Float_t fTime; //COMMENT
+
+ /** The energy in GeV */
+ Float_t fEnergy; //COMMENT
+
+ /** The gain */
+ Int_t fGain; //COMMENT
+
+ /** The number of samples */
+ Int_t fSamples; //COMMENT
+
+ /** The number of pre samples */
+ Int_t fPreSamples; //COMMENT
+
+ /** The total number of samples */
+ Int_t fTotalSamples; //COMMENT
- Int_t fDebugVar; //can be anything, not intended for use in analysis
+ /** A debug variable */
+ Int_t fDebugVar; //COMMENT
- Int_t *fData; //[fTotalSamples]
+ /** Pointer to the digit raw data */
+ Int_t *fData; //[fTotalSamples]
+
+ /** The crazyness */
+ Int_t fCrazyness; //COMMENT
- Int_t fCrazyness; //comment
- Float_t fBaseline; //comment
+ /** The baseline */
+ Float_t fBaseline; //COMMENT
ClassDef(AliHLTPHOSDigit, 1);
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
+x * without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
#ifndef ALIHLTPHOSDIGITCONTAINERSTRUCT_H
#define ALIHLTPHOSDIGITCONTAINERSTRUCT_H
+/**
+ * Digit data struct for PHOS HLT
+ *
+ * @file AliHLTPHOSDigitContainerDataStruct.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Digit container data struct for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "Rtypes.h"
#include "AliHLTPHOSDigitDataStruct.h"
+
+/**
+ * @struct AliHLTPHOSDigitContainerDataStruct
+ * Digit container data struct for PHOS HLT
+ *
+ * @ingroup alihlt_phos
+ */
struct AliHLTPHOSDigitContainerDataStruct
{
- UInt_t fNDigits;
- UInt_t fPHOSModule;
- AliHLTPHOSDigitDataStruct fDigitDataStruct[7168];
+
+ /** Number of digits in container */
+ UInt_t fNDigits; //COMMENT
+
+ /** Module number */
+ UInt_t fPHOSModule; //COMMENT
+
+ /** Array of digits in container */
+ AliHLTPHOSDigitDataStruct fDigitDataStruct[7168]; //COMMENT
+
};
#ifndef ALIHLTPHOSDIGITDATASTRUCT_H
#define ALIHLTPHOSDIGITDATASTRUCT_H
+/**
+ * Digit struct for PHOS HLT
+ *
+ * @file AliHLTPHOSDigitDataStruct.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Digit struct for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSBase.h"
+/**
+ * @struct AliHLTPHOSDigitDataStruct
+ * Digit struct for PHOS HLT
+ *
+ * @ingroup alihlt_phos
+ */
struct AliHLTPHOSDigitDataStruct
{
+ /** The x coordinate */
Int_t fX;
+
+ /** The x coordinate */
Int_t fZ;
+
+ /** The module number */
Int_t fModule;
+
+ /** The amplitude in ADC counts */
Float_t fAmplitude;
+
+ /** The time in sample count */
Float_t fTime;
+
+ /* The energy in GeV */
Float_t fEnergy;
+
+ /** The gain */
Int_t fGain;
+ /** The raw data */
Int_t fData[512];
+ /** The crazyness */
Int_t fCrazyness;
+
+ /** The baseline */
Float_t fBaseline;
+ /**
+ * Set the raw data
+ * @param data is a pointer to the raw data
+ */
void SetRawData(Int_t *data)
{
for(Int_t i = 0; i < 512; i++)
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+ /**
+ * @file AliHLTPHOSClusterizer.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Clusterizer for PHOS HLT
+ */
+
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSDigitMaker.h"
#include "AliHLTPHOSDigit.h"
#include "AliHLTPHOSValidCellDataStruct.h"
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-//#include "AliHLTPHOSDigitContainerStruct.h"
#include "AliHLTPHOSDigitDataStruct.h"
#include "AliHLTPHOSDigitContainerDataStruct.h"
-
-//ClassImp(AliHLTPHOSDigitMaker);
+
+ClassImp(AliHLTPHOSDigitMaker);
using namespace PhosHLTConst;
fNrPresamples(10),
fDigitThreshold(0)
{
-
+ // See header file for documentation
}
AliHLTPHOSDigitMaker::~AliHLTPHOSDigitMaker()
{
- //comment
+ //See header file for documentation
}
Int_t
AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
{
- //comment
+ //See header file for documentation
Int_t i = 0;
Int_t j = 0;
Int_t x = -1;
void
AliHLTPHOSDigitMaker::Reset()
{
- // fDigitArrayPtr->Clear();
+ //fDigitArrayPtr->Clear();
fDigitCount = 0;
}
#ifndef ALIHLTPHOSDIGITMAKER_H
#define ALIHLTPHOSDIGITMAKER_H
+/**
+ * Class makes digits from information from raw data
+ *
+ * @file AliHLTPHOSDigitMaker.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Digit maker for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSBase.h"
#include "AliHLTPHOSConstants.h"
+/**
+ * @class AliHLTPHOSDigitMaker
+ * Digit maker for PHOS HLT. Takes input from AliHLTPHOSRawAnalyzer, and
+ * outputs an AliHLTPHOSDigitDataStruct container, or a TClonesArray of
+ * AliHLTPHOSDigit. Can do software zero suppression
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSDigit;
class TClonesArray;
class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
{
public:
+
+ /** Constructor */
AliHLTPHOSDigitMaker();
+
+ /** Destructor */
virtual ~AliHLTPHOSDigitMaker();
// void SetValidCellData(AliHLTPHOSValidCellDataStruct *data) { fCellDataPtr = data; }
// void SetDigitContainerStruct(AliHLTPHOSDigitContainerStruct *container)
//{ fDigitContainerStructPtr = container; }
-
+
+ /**
+ * Sets the AliHLTPHOSDigitDataStruct container
+ * @param container the digit container
+ */
void SetDigitContainerStruct(AliHLTPHOSDigitContainerDataStruct *container)
{ fDigitContainerStructPtr = container; }
-
+
+ /**
+ * Sets the TClonesArray of AliHLTPHOSDigit
+ * @param array the array
+ */
void SetDigitArray(TClonesArray *array) { fDigitArrayPtr = array; }
- void ResetDigitCount() { fDigitCount = 0; }
+
+ /**
+ * Sets the digit threshold
+ * @param threshold the threshold
+ */
void SetDigitThreshold(Int_t threshold) { fDigitThreshold = threshold; }
+
+ /**
+ * Sets the number of pre samples
+ * @param n the number of pre samples
+ */
void SetNrPresamples(Int_t n) { fNrPresamples = n; }
- Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct*);
+
+ /**
+ * Make the digits for one event.
+ * @param rcuCellEnergies is the data from the AliHLTPHOSRawAnalyzer
+ * @return the number of digits found
+ */
+ Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuCellEnergies);
+
+ /** Reset the digit maker */
void Reset();
private:
- AliHLTPHOSValidCellDataStruct *fCellDataPtr; //comment
- AliHLTPHOSDigitContainerDataStruct *fDigitContainerStructPtr; //comment
- TClonesArray *fDigitArrayPtr; //comment
- AliHLTPHOSDigit *fDigitPtr; //comment
- //AliHLTPHOSDigitDataStruct *fDigitStructPtr; //comment
- AliHLTPHOSDigitDataStruct *fDigitStructPtr; //comment
- Int_t fDigitCount; //comment
- Int_t fNrPresamples; //comment
+ /** Pointer to valid cell list */
+ AliHLTPHOSValidCellDataStruct *fCellDataPtr; //! transient
+
+ /** Pointer to the digit container */
+ AliHLTPHOSDigitContainerDataStruct *fDigitContainerStructPtr; //! transient
+
+ /** Pointer to the digit TClonesArray */
+ TClonesArray *fDigitArrayPtr; //! transient
+
+ /** Pointer to a AliHLTPHOSDigit */
+ AliHLTPHOSDigit *fDigitPtr; //! transient
+
+ /** Pointer to a AliHLTPHOSDigitDataStruct */
+ AliHLTPHOSDigitDataStruct *fDigitStructPtr; //! transient
+
+ /** Digit count */
+ Int_t fDigitCount;
+
+ /** Number of presamples */
+ Int_t fNrPresamples;
- Float_t fDigitThreshold; //comment
+ /** Threshold for making digit ( zero suppression threshold) */
+ Float_t fDigitThreshold;
- // ClassDef(AliHLTPHOSDigitMaker, 1);
+ ClassDef(AliHLTPHOSDigitMaker, 1);
};
#include <sys/stat.h>
#include <sys/types.h>
+
+/**
+ * @file AliHLTPHOSDigitMakerComponent.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A digit maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+
const AliHLTComponentDataType AliHLTPHOSDigitMakerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
AliHLTPHOSDigitMakerComponent gAliHLTPHOSDigitMakerComponent;
fDigitMakerPtr(0)
// fEvtCnt(0)
{
- //comment
+ //see header file for documentation
}
AliHLTPHOSDigitMakerComponent::~AliHLTPHOSDigitMakerComponent()
{
- //comment
+ //see header file for documentation
}
int
AliHLTPHOSDigitMakerComponent::Deinit()
{
- //comment
+ //see header file for documentation
if(fDigitMakerPtr)
{
delete fDigitMakerPtr;
const char*
AliHLTPHOSDigitMakerComponent::GetComponentID()
{
- //comment
+ //see header file for documentation
return "PhosDigitMaker";
}
AliHLTPHOSDigitMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
{
- //Get datatypes for input
+ //see header file for documentation
+
const AliHLTComponentDataType* pType=fgkInputDataTypes;
while (pType->fID!=0) {
list.push_back(*pType);
AliHLTComponentDataType
AliHLTPHOSDigitMakerComponent::GetOutputDataType()
{
- //comment
+ //see header file for documentation
return AliHLTPHOSDefinitions::fgkAliHLTDigitDataType;
}
void
AliHLTPHOSDigitMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
{
- //comment
+ //see header file for documentation
constBase = 30;
inputMultiplier = 1;
}
AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
- //Do event
+ //see header file for documentation
+
UInt_t tSize = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
int
AliHLTPHOSDigitMakerComponent::DoInit(int argc, const char** argv )
{
- //Do initialization
+ //see header file for documentation
fDigitMakerPtr = new AliHLTPHOSDigitMaker();
AliHLTComponent*
AliHLTPHOSDigitMakerComponent::Spawn()
{
- //comment
+ //see header file for documentation
return new AliHLTPHOSDigitMakerComponent();
}
#ifndef ALIHLTPHOSDIGITMAKERCOMPONENT_H
#define ALIHLTPHOSDIGITMAKERCOMPONENT_H
-#include "AliHLTPHOSProcessor.h"
+/** @file AliHLTPHOSDigitMakerComponent.h
+ @author Oystein Djuvsland
+ @date
+ @brief A digit maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+#include "AliHLTPHOSProcessor.h"
class AliHLTPHOSDigitMaker;
class TTree;
class AliHLTPHOSDigitContainerDataStruct;
+/**
+ * @class AliHLTPHOSDigitMakerComponent
+ *
+ * Class runs AliHLTPHOSDigitMaker, creating digits from "raw data"
+ *
+ * The component has the following component arguments:
+ * -threshold threshold for creating a digit, gives software zero suppression
+ * -presamples number of presamples (not really necessary)
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSDigitMakerComponent : public AliHLTPHOSProcessor
{
public:
+
+ /** Constructor */
AliHLTPHOSDigitMakerComponent();
+
+ /** Destructor */
virtual ~AliHLTPHOSDigitMakerComponent();
+ /** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
+ /** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+ /** interface function, see @ref AliHLTComponent for description */
int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
protected:
- using AliHLTPHOSProcessor::DoEvent;
+
+ /** interface function, see @ref AliHLTComponent for description */
int DoInit(int argc, const char** argv);
+
+ using AliHLTPHOSProcessor::DoEvent;
+
+ /** interface function, see @ref AliHLTComponent for description */
virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
private:
- AliHLTPHOSDigitMaker *fDigitMakerPtr; //comment
- AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //comment
- // UInt_t fEvtCnt; //comment
- // Int_t fRunNb; //comment
+ /** Pointer to the digit maker it self */
+ AliHLTPHOSDigitMaker *fDigitMakerPtr; //! transient
+
+ /** The output of the component, digits in a container */
+ AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
+
+ /** Event count */
+ UInt_t fEvtCnt;
+
static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
};
+++ /dev/null
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-ClassDef(AliHLTPHOSEnergyEqualizer);
-
-using namespace PhosHLTConst;
-
-AliHLTPHOSEnergyEqualizer::AliHLTPHOSEnergyEqualizer() :
- AliHLTPHOSBase(),
- fDigitContainerPtr(0),
- fGlobalHighGainFactor(0),
- fGlobalLowGainFactor(0),
- fGlobalConversion(true)
-{
-
-}
-
-Int_t
-AliHLTPHOSEnergyEqualizer::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct *cellEnergies)
-{
-
- Int_t nDigits = fDigitDataStruct-fNDigits;
- if(fGlobalConversion)
- {
- for(Int_t i = 0; i < fCnt; i++)
- {
- if(
- fDigitContainerPtr->fDigitDataStruct[nDigits].fModule = cellEnergies->fValidData.fModuleID;
- fDigitContainerPtr->fDigitDataStruct[nDigits].fX = cellEnergies->fValidData.fX + (cellEnergies->fRcuX)*N_XCOLUMNS_RCU;
- fDigitContainerPtr->fDigitDataStruct[nDigits].fZ = cellEnergies->fValidData.fZ + (cellEnergies->fRcuZ)*N_ZROWS_RCU;
- }
- }
- else
- //not implemented yet
+++ /dev/null
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#ifndef ALIHLTPHOSENERGYEQUALIZER_H
-#define ALIHLTPHOSENERGYEQUALIZER_H
-
-class AliHLTPHOSEnergyEqualizer : public AliHLTPHOSBase
-{
-
-public:
- AliHLTPHOSEnergyEqualizer();
-
- virtual ~AliHLTPHOSEnergyEqualizer();
-
- void SetGlobalHighGainConversionFactor(Float_t factor) { fGlobalHighGainFactor = factor; }
- void SetGlobalLowGainConversionFactor(Float_t factor) { fGlobalLowGainFactor = factor; }
- void SetGlobalConversion() { fGlobalConversion = true; }
-
- void SetDigitContainer(AliHLTPHOSDigitContainerStruct *digConPtr) { fDigitContainerPtr = digConPtr; }
-
- Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct*);
-
-private:
- AliHLTPHOSDigitContainerStruct *fDigitContainerPtr;
-
- Float_t fGlobalHighGainFactor;
- Float_t fGlobalLowGainFactor;
- Bool_t fGlobalConversion;
-
- ClassImp(AliHLTPHOSEnergyEqualizer, 1);
-
-#endif
+++ /dev/null
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#include "AliHLTPHOSMIPCounter.h"
-#include "AliHLTPHOSDigitContainerDataStruct.h"
-#include "TH2I.h"
-
-AliHLTPHOSMIPCounter::AliHLTPHOSMIPCounter()
- : AliHLTPHOSBase(),
- fMIPCountEvent ( 0 ),
- fMIPCountTotal ( 0 ),
- fMIPRate ( 0 ),
- fLowerBound ( 0 ),
- fUpperBound ( 0 ),
- fUpperStartTime ( 0 ),
- fLowerStartTime ( 0 ),
- fZeroThreshold ( 0 ),
- fChannelHistPtr ( 0 )
-{
-
-}
-
-
-AliHLTPHOSMIPCounter::~AliHLTPHOSMIPCounter()
-{
-}
-
-Int_t
-AliHLTPHOSMIPCounter::CountMIPs(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
-{
- fMIPCountEvent = 0;
- Bool_t IsMIP = true;
- Int_t *dataPtr = 0;
- AliHLTPHOSDigitDataStruct *digitPtr;
- for(UInt_t i = 0; i < digitContainerPtr->fNDigits; i++)
- {
- digitPtr = &(digitContainerPtr->fDigitDataStruct[i]);
- dataPtr = digitPtr->fData;
- if(digitPtr->fCrazyness != 0)
- {
- continue;
- }
- if(digitPtr->fAmplitude < fLowerBound || digitPtr->fAmplitude > fUpperBound)
- {
- continue;
- }
- for(Int_t time = (Int_t)(digitPtr->fTime - 2); time < (digitPtr->fTime - 3); time++)
- {
- if((Float_t)dataPtr[time] < (digitPtr->fAmplitude - (digitPtr->fAmplitude)/10))
- {
- IsMIP = false;
- break;
- }
- }
- if(!IsMIP)
- continue;
- for(Int_t sample = 0; sample < fLowerStartTime; sample++)
- {
- if(dataPtr[sample] > fZeroThreshold || dataPtr[sample] < -fZeroThreshold)
- {
- IsMIP = false;
- break;
- }
- }
- if(dataPtr[(Int_t)fUpperStartTime + 3] < fZeroThreshold)
- IsMIP = false;
- if(IsMIP)
- {
- fMIPCountEvent++;
- fChannelHistPtr->Fill(digitPtr->fX, digitPtr->fZ);
- }
- }
- fMIPCountTotal += fMIPCountEvent;
- return fMIPCountEvent;
-}
+++ /dev/null
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#ifndef ALIHLTPHOSMIPCOUNTER_H
-#define ALIHLTPHOSMIPCOUNTER_H
-
-#include "AliHLTPHOSBase.h"
-
-class AliHLTPHOSDigitContainerDataStruct;
-class TH2I;
-
-/**
- @author Øystein Djuvsland <oystein.djuvsland@gmail.com>
-*/
-
-class AliHLTPHOSMIPCounter : public AliHLTPHOSBase
- {
- public:
- /**
- * Default constructor
- */
- AliHLTPHOSMIPCounter();
-
- /**
- * Default destructor
- */
- ~AliHLTPHOSMIPCounter();
-
- /**
- * This functions counts the number of approved MIP hits in one digit container
- * @param digitContainer ContainerStruct for digits
- * @return Number of approved MIP hits
- */
- Int_t CountMIPs(AliHLTPHOSDigitContainerDataStruct* digitContainer);
-
-
- /**
- * Sets the upper bound of the amplitude accepted for a MIP
- * @param val Upper bound value
- */
- void SetUpperBound ( const Float_t& val ) { fUpperBound = val; }
-
- /**
- * Gets the upper bound of the amplitude accepted for a MIP
- * @return Upper bound value
- */
- Float_t GetUpperBound() const { return fUpperBound; }
-
- /**
- * Sets the lower bound of the amplitude accepted for a MIP
- * @param val lower bound value
- */
- void SetLowerBound ( const Float_t& val ) { fLowerBound = val; }
-
- /**
- * Gets the lower bound of the amplitude accepted for a MIP
- * @return Lower bound value
- */
- Float_t GetLowerBound() const { return fLowerBound; }
-
- /**
- * Sets the upper bound for the start time of the signal, i.e. where the
- * baseline shouldn't be zero anymore
- * @param val Upper start time
- */
- void SetUpperStartTime ( const Float_t& val ) { fUpperStartTime = val; }
-
- /**
- * Sets the upper bound for the start time of the signal, i.e. where the
- * baseline shouldn't be zero anymore
- * @return Upper start time
- */
- Float_t GetUpperStartTime() const { return fUpperStartTime; }
-
- /**
- * Sets the lower bound for the start time of the signal, i.e. where the
- * baseline shouldn't be zero anymore
- * @param val Lower start time
- */
- void SetLowerStartTime ( const Float_t& val ) { fLowerStartTime = val; }
-
- /**
- * Gets the lower bound for the start time of the signal, i.e. where the
- * baseline shouldn't be zero anymore
- * @return Lower start time
- */
- Float_t GetLowerStartTime() const { return fLowerStartTime; }
-
- /**
- * Sets the threshold for what is zero when checking the baseline
- * @param val Zero threshold
- */
- void SetZeroThreshold ( const Float_t& val ) { fZeroThreshold = val; }
-
- /**
- * Gets the threshold for what is zero when checking the baseline
- * @return Zero threshold
- */
- Float_t GetZeroThreshold() const { return fZeroThreshold; }
-
- /**
- * Get the total count of MIPs which the MIP counter has seen
- * @return Total count of MIPs
- */
- Int_t GetMIPCountTotal() const { return fMIPCountTotal; }
-
- /**
- * Get the total count of MIPs in the last event
- * @return Total count of MIPs in last event
- */
- Int_t GetMIPCountEvent() const { return fMIPCountEvent; }
-
- /**
- * Sets a pointer to the TH2I histogram of channels with MIP hits
- * @param hist Pointer to the histogram
- */
- void SetChannelHistogram(TH2I *hist) { fChannelHistPtr = hist; }
-
- /**
- * Get the pointer to the TH2I histogram of channels with MIP hits
- * @return Pointer to the histogram
- */
- TH2I* GetChannelHistogram() { return fChannelHistPtr; }
-
-
- private:
- Int_t fMIPCountEvent; //comment
- Int_t fMIPCountTotal; //comment
- Float_t fMIPRate; //comment
- Float_t fLowerBound; //comment
- Float_t fUpperBound; //comment
- Float_t fUpperStartTime; //comment
- Float_t fLowerStartTime; //comment
- Float_t fZeroThreshold; //comment
- TH2I *fChannelHistPtr; //comment
- };
-
-#endif
+++ /dev/null
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#include "AliHLTPHOSMIPCounterComponent.h"
-#include "AliHLTPHOSProcessor.h"
-#include "AliHLTPHOSMIPCounter.h"
-#include "TH1I.h"
-#include "TH1F.h"
-#include "TH2I.h"
-#include "TFile.h"
-#include "AliHLTPHOSDigitContainerDataStruct.h"
-
-
-const AliHLTComponentDataType AliHLTPHOSMIPCounterComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
-AliHLTPHOSMIPCounterComponent gAliHLTPHOSMIPCounterComponent;
-
-AliHLTPHOSMIPCounterComponent::AliHLTPHOSMIPCounterComponent()
- : AliHLTPHOSProcessor(),
- fEvtCnt ( 0 ),
- fInterval ( 0 ),
- fMIPCount ( 0 ),
- fTRUThreshold ( 0 ),
- fMIPCountInterval ( 0 ),
- fPath ( 0 ),
- fMIPCounterPtr ( 0 ),
- fHistPtr ( 0 ),
- fIntervalHistPtr ( 0 ),
- fRateHistPtr ( 0 ),
- fChannelHistPtr ( 0 ),
- fRatioHistPtr ( 0 )
-{
-}
-
-
-AliHLTPHOSMIPCounterComponent::~AliHLTPHOSMIPCounterComponent()
-{
-}
-
-int
-AliHLTPHOSMIPCounterComponent::Deinit()
-{
- printf("AliHLTPHOSMIPCounterComponent::Deinit()\n");
- char filename[50];
- sprintf(filename, "%s/MIPCount_TRUThreshold%s.root", fPath, fTRUThreshold);
- TFile *outfile = new TFile(filename, "recreate");
- fHistPtr->Write();
- fIntervalHistPtr->Write();
- fRateHistPtr->Write();
- fChannelHistPtr->Write();
- fRatioHistPtr->Write();
- outfile->Close();
-
- printf("Total number of MIPs in %d events: %d\nGives a rate of: %f\n", fEvtCnt, fMIPCounterPtr->GetMIPCountTotal(),
- ((float)(fMIPCounterPtr->GetMIPCountTotal()))/((float)fEvtCnt));
-
- return 0;
-}
-
-const char*
-AliHLTPHOSMIPCounterComponent::GetComponentID()
-{
- return "PhosMIPCounter";
-}
-
-void
- AliHLTPHOSMIPCounterComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
-{
- //Get datatypes for input
- const AliHLTComponentDataType* pType=fgkInputDataTypes;
- while (pType->fID!=0) {
- list.push_back(*pType);
- pType++;
- }
-}
-
-AliHLTComponentDataType
-AliHLTPHOSMIPCounterComponent::GetOutputDataType()
-{
- return AliHLTPHOSDefinitions::fgkAliHLTMIPDataType;
-}
-
-
-void
- AliHLTPHOSMIPCounterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
-{
- constBase = 30;
- inputMultiplier = 1;
-}
-
-int
-AliHLTPHOSMIPCounterComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t& /*size*/, //TODO: I think size should be set to zero when returning from this method if not data was written to the output buffer.
- vector<AliHLTComponentBlockData>& /*outputBlocks*/)
-{
- //Do event
- int digitCount = 0;
-
- const AliHLTComponentBlockData* iter = 0;
- unsigned long ndx;
-
- for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
- {
- iter = blocks+ndx;
-
- if(iter->fDataType != AliHLTPHOSDefinitions::fgkAliHLTDigitDataType)
- {
- // cout << "Warning: data type is not fgkCellEnergyDataType " << endl;
- continue;
- }
- digitCount += (reinterpret_cast<AliHLTPHOSDigitContainerDataStruct*>(iter->fPtr))->fNDigits;
- fMIPCount += fMIPCounterPtr->CountMIPs(reinterpret_cast<AliHLTPHOSDigitContainerDataStruct*>(iter->fPtr));
- }
- fRatioHistPtr->Fill((float)(((float)fMIPCount)/((float)digitCount)));
- fEvtCnt++;
- fMIPCountInterval += fMIPCount;
- fMIPCount = 0;
-
- if(fEvtCnt % fInterval == 0)
- {
- printf("Event #: %d -- Number of MIPs the last %d events: %d -- Which gives a rate of: %f\n",
- fEvtCnt, fInterval, Int_t(fMIPCountInterval), ((Float_t)fMIPCountInterval/(Float_t)fInterval)); //TODO: check that the proper things are being written to screen.
- fIntervalHistPtr->Fill(fMIPCountInterval);
- fRateHistPtr->Fill((Float_t)fMIPCountInterval/(Float_t)fInterval);
- fMIPCountInterval = 0;
- }
-
- return 0;
-}
-
-
-int
-AliHLTPHOSMIPCounterComponent::DoInit(int argc, const char** argv )
-{
- //Do initialization
- cout << "Initializing AliHLTPHOSMIPCounterComponent...\n";
- cout << endl;
- Char_t intervalHistName[50];
- Char_t rateHistName[50];
- fPath = new Char_t[50];
- fTRUThreshold = new Char_t[50];
- fMIPCounterPtr = new AliHLTPHOSMIPCounter();
- for(int i = 0; i < argc; i++)
- {
- if(!strcmp("-interval", argv[i]))
- {
- fInterval = atoi(argv[i+1]);
- }
- if(!strcmp("-path", argv[i]))
- {
- strcpy(fPath, argv[i+1]);
- }
- if(!strcmp("-upperbound", argv[i]))
- {
- fMIPCounterPtr->SetUpperBound(atoi(argv[i+1]));
- }
- if(!strcmp("-lowerbound", argv[i]))
- {
- fMIPCounterPtr->SetLowerBound(atoi(argv[i+1]));
- }
- if(!strcmp("-zerothreshold", argv[i]))
- {
- fMIPCounterPtr->SetZeroThreshold(atoi(argv[i+1]));
- }
- if(!strcmp("-truthreshold", argv[i]))
- {
- strcpy(fTRUThreshold, argv[i+1]);
- }
- if(!strcmp("-lowerstarttime", argv[i]))
- {
- fMIPCounterPtr->SetLowerStartTime(atoi(argv[i+1]));
- }
- if(!strcmp("-upperstarttime", argv[i]))
- {
- fMIPCounterPtr->SetUpperStartTime(atoi(argv[i+1]));
- }
- }
-
- sprintf(intervalHistName, "Number of MIPs in %d Events", fInterval);
- sprintf(rateHistName, "MIP Rate for %d Events", fInterval);
-
- fHistPtr = new TH1I("MIPHist", "Number of MIPs in event", 20, 0, 100);
- fIntervalHistPtr = new TH1I("intervalMIPHist", intervalHistName, 100, 0, 500);
- fRateHistPtr = new TH1F("rateHist", rateHistName, 100, 0, 100);
- fChannelHistPtr = new TH2I("channelHist", "MIP Hits in Channels", 64, 0, 63, 56, 0, 55);
- fRatioHistPtr = new TH1F("ratioHist", "Ratio of MIP digits in Event", 100, 0, 0.2);
-
- fMIPCounterPtr->SetChannelHistogram(fChannelHistPtr);
-
-
- return 0;
-}
-
-AliHLTComponent*
- AliHLTPHOSMIPCounterComponent::Spawn()
-{
- return new AliHLTPHOSMIPCounterComponent();
-}
+++ /dev/null
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#ifndef ALIHLTPHOSMIPCOUNTERCOMPONENT_H
-#define ALIHLTPHOSMIPCOUNTERCOMPONENT_H
-
-#include "AliHLTPHOSProcessor.h"
-
-class AliHLTPHOSMIPCounter;
-class TH1F;
-class TH1I;
-class TH2I;
-
-/**
- @author Øystein Djuvsland <oystein.djuvsland@gmail.com>
-*/
-class AliHLTPHOSMIPCounterComponent : public AliHLTPHOSProcessor
-{
-public:
- AliHLTPHOSMIPCounterComponent();
-
- virtual ~AliHLTPHOSMIPCounterComponent();
-
- const char* GetComponentID();
-
- void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
-
- AliHLTComponentDataType GetOutputDataType();
-
- void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-
- int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- std::vector<AliHLTComponentBlockData>& outputBlocks);
-
- AliHLTComponent* Spawn();
-
-protected:
- using AliHLTPHOSProcessor::DoEvent;
- int DoInit(int argc, const char** argv);
- virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
-
-private:
-
- Int_t fEvtCnt; //comment
- Int_t fInterval; //comment
- Int_t fMIPCount; //comment
- Char_t *fTRUThreshold; //comment
- Float_t fMIPCountInterval; //comment
- Char_t *fPath; //comment
- AliHLTPHOSMIPCounter *fMIPCounterPtr; //comment
- TH1I *fHistPtr; //comment
- TH1I *fIntervalHistPtr; //comment
- TH1F *fRateHistPtr; //comment
- TH2I *fChannelHistPtr; //comment
- TH1F *fRatioHistPtr; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
-};
-#endif
-
-
+++ /dev/null
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#include "AliHLTPHOSNoiseMapper.h"
-#include "AliHLTPHOSBase.h"
-#include "AliHLTPHOSDigitDataStruct.h"
-#include "AliHLTPHOSDigitContainerDataStruct.h"
-#include "AliHLTPHOSConstants.h"
-
-using namespace std;
-
-AliHLTPHOSNoiseMapper::AliHLTPHOSNoiseMapper()
- : AliHLTPHOSBase(),
- //fChannelArray(0),
- fNoiseThreshold(10)
-{
- for(Int_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(Int_t z = 0; z < N_ZROWS_MOD; z++)
- {
- for(Int_t gain = 0; gain < N_GAINS; gain++)
- {
- fChannelArray[x][z][gain] = 0;
- }
- }
- }
-}
-
-
-AliHLTPHOSNoiseMapper::~AliHLTPHOSNoiseMapper()
-{
-}
-
-
-void
-AliHLTPHOSNoiseMapper::MapNoisyChannels(AliHLTPHOSDigitContainerDataStruct *digitContainerPtr)
-{
- AliHLTPHOSDigitDataStruct *digitPtr = 0;
- for(Int_t i = 0; i < digitContainerPtr->fNDigits; i++)
- {
- digitPtr = &(digitContainerPtr->fDigitDataStruct[i]);
- if(digitPtr->fAmplitude > fNoiseThreshold)
- {
- fChannelArray[digitPtr->fX][digitPtr->fZ][digitPtr->fGain]++;
- }
- }
-}
-
-void
-AliHLTPHOSNoiseMapper::GetChannelArray(Int_t channelArray[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS])
-{
- for(Int_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(Int_t z = 0; z < N_ZROWS_MOD; z++)
- {
- for(Int_t gain = 0; gain < N_GAINS; gain++)
- {
- channelArray[x][z][gain] = fChannelArray[x][z][gain];
- }
- }
- }
-}
+++ /dev/null
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-
-#ifndef ALIHLTPHOSNOISEMAPPER_H
-#define ALIHLTPHOSNOISEMAPPER_H
-
-#include <AliHLTPHOSBase.h>
-
-class AliHLTPHOSDigitContainerDataStruct;
-
-/**
-
-
- @author Oystein Djuvsland <oystein.djuvsland@gmail.com>
-*/
-class AliHLTPHOSNoiseMapper : public AliHLTPHOSBase
-{
-public:
- AliHLTPHOSNoiseMapper();
-
- ~AliHLTPHOSNoiseMapper();
-
- void MapNoisyChannels(AliHLTPHOSDigitContainerDataStruct *fDigitContainer);
-
- //void SetChannelArray ( Int_t* val ) { fChannelArrayPtr = val; }
- void GetChannelArray(Int_t channelArray[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]);
- void SetNoiseThreshold ( Float_t val ) { fNoiseThreshold = val; }
- Float_t GetNoiseThreshold() const { return fNoiseThreshold; }
-
-
-private:
-
- Int_t fChannelArray[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
- Float_t fNoiseThreshold;
-
-};
-
-#endif
+++ /dev/null
-//insert copyright
-
-#include "AliHLTPHOSNoiseMapperComponent.h"
-#include "AliHLTPHOSNoiseMapper.h"
-#include "AliHLTPHOSDigitDataStruct.h"
-#include "AliHLTPHOSBaseline.h"
-#include "AliHLTPHOSProcessor.h"
-#include "TH2I.h"
-#include "TFile.h"
-//#include <direct.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-const AliHLTComponentDataType AliHLTPHOSNoiseMapperComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
-AliHLTPHOSNoiseMapperComponent gAliHLTPHOSNoiseMapperComponent;
-
-AliHLTPHOSNoiseMapperComponent::AliHLTPHOSNoiseMapperComponent() :
- AliHLTPHOSProcessor(),
- fNoiseMapperPtr(0),
- fWriteInterval(100),
- fFilename(0),
- fDirectory(0),
- fRunNb(0),
- fRateThreshold(10)
-{
-
-}
-
-AliHLTPHOSNoiseMapperComponent::~AliHLTPHOSNoiseMapperComponent()
-{
-}
-
-int
-AliHLTPHOSNoiseMapperComponent::Deinit()
-{
-
- char filename [50];
- sprintf(filename, "%s/run%d_noisemap.root", fDirectory, fRunNb);
-
- FillHistograms();
-
- cout << "Writing file...";
- TFile *outfile = new TFile(filename,"recreate");
- fNoiseCountLowGainHistPtr->Write();
- fNoiseCountHighGainHistPtr->Write();
- fNoiseMapLowGainHistPtr->Write();
- fNoiseMapHighGainHistPtr->Write();
- delete outfile;
- outfile = 0;
- cout << "Done!\n";
-
- if(fNoiseMapperPtr)
- {
- delete fNoiseMapperPtr;
- fNoiseMapperPtr = 0;
- }
- if(fFilename)
- {
- delete fFilename;
- fFilename = 0;
- }
-}
-
-const char*
-AliHLTPHOSNoiseMapperComponent::GetComponentID()
-{
- return "PhosNoiseMapper";
-}
-
-void
-
-AliHLTPHOSNoiseMapperComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
-{
- //Get datatypes for input
- const AliHLTComponentDataType* pType=fgkInputDataTypes;
- while (pType->fID!=0) {
- list.push_back(*pType);
- pType++;
- }
-}
-
-AliHLTComponentDataType
-AliHLTPHOSNoiseMapperComponent::GetOutputDataType()
-{
- return AliHLTPHOSDefinitions::fgkAliHLTNoiseMapDataType;
-}
-
-
-void
-AliHLTPHOSNoiseMapperComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
-{
- constBase = 30;
- inputMultiplier = 1;
-}
-
-int
-AliHLTPHOSNoiseMapperComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- std::vector<AliHLTComponentBlockData>& outputBlocks)
-{
- //Do event
-
- UInt_t tSize = 0;
- UInt_t offset = 0;
- UInt_t mysize = 0;
- Int_t nRecPoints = 0;
- Int_t index = 0;
-
- Int_t fileCount = 0;
- Int_t digitCount = 0;
- char filename [50];
-
-
- AliHLTUInt8_t* outBPtr;
- outBPtr = outputPtr;
- const AliHLTComponentBlockData* iter = 0;
- unsigned long ndx;
-
- for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
- {
- iter = blocks+ndx;
-
- if(iter->fDataType != AliHLTPHOSDefinitions::fgkCellEnergyDataType)
- {
- // cout << "Warning: data type is not fgkCellEnergyDataType " << endl;
- continue;
-
- }
- fNoiseMapperPtr->MapNoisyChannels(reinterpret_cast<AliHLTPHOSDigitContainerDataStruct*>(iter->fPtr));
- }
-
- fEventCount++;
-
- //PushBack(fDigitArrayPtr, kAliHLTAnyDataType, (AliHLTUInt32_t)0);
-
- if(fEventCount % 10 == 0)
- {
- cout << "Event #: " << fEventCount << endl;
- }
-
- if(fEventCount % fWriteInterval == 0)
- {
- char filename [50];
- sprintf(filename, "%s/run%d_noisemap.root", fDirectory, fRunNb);
-
- FillHistograms();
-
- cout << "Writing file...";
- TFile *outfile = new TFile(filename,"recreate");
- fNoiseCountLowGainHistPtr->Write();
- fNoiseCountLowGainHistPtr->Write();
- fNoiseMapLowGainHistPtr->Write();
- fNoiseMapHighGainHistPtr->Write();
- delete outfile;
- outfile = 0;
- cout << "Done!\n";
- }
-
- return 0;
-}
-
-
-int
-AliHLTPHOSNoiseMapperComponent::DoInit(int argc, const char** argv )
-{
-
- Bool_t pathSet = false;
- Bool_t nSamplesSet = false;
-
- fDirectory = new char[50];
-
- fNoiseMapperPtr = new AliHLTPHOSNoiseMapper();
-
- fNoiseCountLowGainHistPtr = new TH2I("noiseCountLowGain", "Noise count for low gain channels", 64, 0, 63, 56, 0, 55);
- fNoiseCountHighGainHistPtr = new TH2I("noiseCountHighGain", "Noise count for high gain channels", 64, 0, 63, 56, 0, 55);
- fNoiseMapLowGainHistPtr = new TH2I("noiseMapLowGain", "Noise map for low gain channels", 64, 0, 63, 56, 0, 55);
- fNoiseMapHighGainHistPtr = new TH2I("noiseMapHighGain", "Noise map for high gain channels", 64, 0, 63, 56, 0, 55);
-
- for(int i = 0; i < argc; i++)
- {
- if(!strcmp("-path", argv[i]))
- {
- strcpy(fDirectory, argv[i+1]);
- pathSet = true;
- }
- if(!strcmp("-noisethreshold", argv[i]))
- {
- fNoiseMapperPtr->SetNoiseThreshold(atof(argv[i+1]));
- }
- }
-
-
- fWriteInterval = 100;
-
- return 0;
-}
-
-AliHLTComponent*
-AliHLTPHOSNoiseMapperComponent::Spawn()
-{
- return new AliHLTPHOSNoiseMapperComponent();
-}
-
-void
-AliHLTPHOSNoiseMapperComponent::FillHistograms()
-{
- Int_t channelArray[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
- fNoiseMapperPtr->GetChannelArray(channelArray);
- for(Int_t x = 0; x < N_XCOLUMNS_MOD; x++)
- {
- for(Int_t z = 0; z < N_ZROWS_MOD; z++)
- {
- fNoiseCountLowGainHistPtr->SetBinContent(x, z, channelArray[x][z][0]);
- fNoiseCountHighGainHistPtr->SetBinContent(x, z, channelArray[x][z][1]);
- if((channelArray[x][z][0]/fEventCount) > fRateThreshold)
- {
- fNoiseMapLowGainHistPtr->SetBinContent(x, z, 10);
- }
- if((channelArray[x][z][1]/fEventCount) > fRateThreshold)
- {
- fNoiseMapHighGainHistPtr->SetBinContent(x, z, 10);
- }
- }
- }
-}
+++ /dev/null
-//insert copyright
-
-#ifndef ALIHLTPHOSNOISEMAPPERCOMPONENT_H
-#define ALIHLTPHOSNOISEMAPPERCOMPONENT_H
-
-#include "AliHLTPHOSProcessor.h"
-
-class AliHLTPHOSNoiseMapper;
-class TH2I;
-
-
-class AliHLTPHOSNoiseMapperComponent : public AliHLTPHOSProcessor
-{
-public:
- AliHLTPHOSNoiseMapperComponent();
- ~AliHLTPHOSNoiseMapperComponent();
-
- const char* GetComponentID();
-
- void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
-
- AliHLTComponentDataType GetOutputDataType();
-
- void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-
- int DoEvent(const AliHLTComponentEventData&, const AliHLTComponentBlockData*,
- AliHLTComponentTriggerData&, AliHLTUInt8_t*, AliHLTUInt32_t&,
- std::vector<AliHLTComponentBlockData>&);
-
- AliHLTComponent* Spawn();
-
-protected:
- int DoInit(int argc, const char** argv);
- virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
- void FillHistograms();
-
-private:
-
- void CalculateAll();
-
- AliHLTPHOSNoiseMapper *fNoiseMapperPtr;
- UInt_t fEventCount;
- UInt_t fWriteInterval;
- char* fDirectory;
- char* fFilename;
- Int_t fRunNb;
- Int_t *fChannelArrayPtr;
- TH2I *fNoiseCountLowGainHistPtr;
- TH2I *fNoiseCountHighGainHistPtr;
- TH2I *fNoiseMapLowGainHistPtr;
- TH2I *fNoiseMapHighGainHistPtr;
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
-
-};
-#endif
-
/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
* *
- * Author: Ã\98ystein Djuvsland <oysteind@ift.uib.no> *
+ * Primary Authors: Oystein Djuvsland *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
+ * about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * @file AliHLTPHOSPhysicsAnalyzer.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Physics analysis base class */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSPhysicsAnalyzer.h"
#include "TVector3.h"
#include "AliPHOSGeometry.h"
#include "Rtypes.h"
#include "AliHLTPHOSCommonDefs.h"
-#include "AliHLTPHOSClusterDataStruct.h"
+#include "AliHLTPHOSRecPointDataStruct.h"
ClassImp(AliHLTPHOSPhysicsAnalyzer);
-AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer():fClustersPtr(0), fRootHistPtr(0), fPHOSRadius(0)
+AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer():fRecPointsPtr(0), fRootHistPtr(0), fPHOSRadius(0)
{
//Constructor
-
+ //See header file for documentation
AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
- fPHOSRadius = geom->GetIPtoCrystalSurface();
-
+ // fPHOSRadius = geom->GetIPtoCrystalSurface();
+ fPHOSRadius = 1500;
+
for(UInt_t i = 0; i < N_MODULES; i++)
{
fRotParametersCos[i] = cos((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
fRotParametersSin[i] = sin((geom->GetPHOSAngle(i+1))*2*TMath::Pi()/360);
}
}
-
+/*
AliHLTPHOSPhysicsAnalyzer::AliHLTPHOSPhysicsAnalyzer(const AliHLTPHOSPhysicsAnalyzer &):fClustersPtr(0), fRootHistPtr(0), fPHOSRadius(0)
{
//Cooy constructor
-
+ //See header file for documentation
AliPHOSGeometry *geom=AliPHOSGeometry::GetInstance("noCPV");
fPHOSRadius = geom->GetIPtoCrystalSurface();
}
}
-
+*/
AliHLTPHOSPhysicsAnalyzer::~AliHLTPHOSPhysicsAnalyzer()
{
//Destructor
-
- fClustersPtr = 0;
+ //See header file for documentation
+ fRecPointsPtr = 0;
fRootHistPtr = 0;
}
void
-AliHLTPHOSPhysicsAnalyzer::LocalPosition(AliHLTPHOSClusterDataStruct* clusterPtr, Float_t* locPositionPtr)
+AliHLTPHOSPhysicsAnalyzer::LocalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* locPositionPtr)
{
- //Get local position for a cluster
+ //Get local position for a recPoint
- locPositionPtr[0] = clusterPtr->fLocalPositionPtr[0];
- locPositionPtr[1] = clusterPtr->fLocalPositionPtr[1];
+ // locPositionPtr[0] = recPointPtr->fLocalPositionPtr[0];
+ //locPositionPtr[1] = recPointPtr->fLocalPositionPtr[1];
}
void
-AliHLTPHOSPhysicsAnalyzer::GlobalPosition(AliHLTPHOSClusterDataStruct* clusterPtr, Float_t* positionPtr)
+AliHLTPHOSPhysicsAnalyzer::GlobalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* positionPtr)
{
- //Get global position for a cluster
-
+ //Get global position for a recPoint
+ //See header file for documentation
Float_t tempPosX = 0;
- Int_t module = clusterPtr->fPHOSModule;
+ // Int_t module = recPointPtr->fPHOSModule;
- tempPosX = kCRYSTAL_SIZE*(clusterPtr->fLocalPositionPtr[0]-N_XCOLUMNS_MOD/2) + kCRYSTAL_SIZE/2;
+ Int_t module = 2;
+
+ tempPosX = kCRYSTAL_SIZE*(recPointPtr->fX-N_XCOLUMNS_MOD/2) + kCRYSTAL_SIZE/2;
positionPtr[0] = tempPosX*fRotParametersSin[module] + fPHOSRadius*fRotParametersCos[module];
positionPtr[1] = tempPosX*fRotParametersCos[module] - fPHOSRadius*fRotParametersSin[module];
- positionPtr[2] = kCRYSTAL_SIZE*(clusterPtr->fLocalPositionPtr[1]-N_ZROWS_MOD/2) + kCRYSTAL_SIZE/2;
+ positionPtr[2] = kCRYSTAL_SIZE*(recPointPtr->fZ-N_ZROWS_MOD/2) + kCRYSTAL_SIZE/2;
}
AliHLTPHOSPhysicsAnalyzer::GlobalPosition(Float_t* locPositionPtr, Float_t* positionPtr, Int_t module)
{
//Get global position from local postion and module number
-
+ //See header file for documentation
positionPtr[0] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersCos[module-1] + fPHOSRadius*fRotParametersSin[module-1];
positionPtr[1] = kCRYSTAL_SIZE*(locPositionPtr[0]-N_XCOLUMNS_MOD/2)*fRotParametersSin[module-1] - fPHOSRadius*fRotParametersCos[module-1];
AliHLTPHOSPhysicsAnalyzer::WriteHistogram(Char_t* fileName)
{
//Write the histogram
-
+ //See header file for documentation
TFile *outfile = new TFile(fileName,"recreate");
fRootHistPtr->Write();
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
#ifndef ALIHLTPHOSPHYSICSANALYZER_H
#define ALIHLTPHOSPHYSICSANALYZER_H
-/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//Intended to be a base class for analysis
+/**
+ * Class is intended to be a base class for physics analysis for
+ * PHOS in HLT
+ *
+ * @file AliHLTPHOSPhysicsAnalyzer.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Physics analysis base class
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "Rtypes.h"
#include "AliHLTPHOSConstants.h"
-using namespace PhosHLTConst;
+using namespace PhosHLTConst;
class TObjArray;
class TH1F;
-class AliHLTPHOSClusterDataStruct;
+class AliHLTPHOSRecPointDataStruct;
const Float_t kCRYSTAL_SIZE = 2.25;
+/**
+ * @class AliHLTPHOSPhysicsAnalyzer
+ * Base class for physics analysis for PHOS in HLT
+ * @ingroup alihlt_phos
+ */
+
class AliHLTPHOSPhysicsAnalyzer
{
public:
+
+ /** Constructor */
AliHLTPHOSPhysicsAnalyzer();
+
+ /** Destructor */
virtual ~AliHLTPHOSPhysicsAnalyzer();
+ /*
AliHLTPHOSPhysicsAnalyzer(const AliHLTPHOSPhysicsAnalyzer & );
AliHLTPHOSPhysicsAnalyzer & operator = (const AliHLTPHOSPhysicsAnalyzer &) {return *this;}
+ */
+
void SetHistogram(TH1F* histPtr) {fRootHistPtr = histPtr;}
- void LocalPosition(AliHLTPHOSClusterDataStruct* clusterPtr, Float_t* locPositionPtr);
- void GlobalPosition(AliHLTPHOSClusterDataStruct* clusterPtr, Float_t* positionPtr);
+ /**
+ * Get the local position of a reconstruction point in the PHOS module
+ * @param recPointPtr is a pointer to the reconstruction point
+ * @param locPositionPtr is a pointer to the array of local coordinates
+ */
+ void LocalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* locPositionPtr);
+
+
+ /**
+ * Get the global position of a reconstruction point in ALICE
+ * @param recPointPtr is a pointer to the reconstruction point
+ * @param locPositionPtr is a pointer to the array where to fill the coord
+ */
+ void GlobalPosition(AliHLTPHOSRecPointDataStruct* recPointPtr, Float_t* positionPtr);
+
+ /**
+ * Get the global position of local coordinates in ALICE
+ * @param locPositionPtr is a pointer to the array of local coordinates
+ * @param positionPtr is a pointer to the array of global coordinates
+ * @param module is the module number (0 - 4)
+ */
void GlobalPosition(Float_t* locPositionPtr , Float_t* positionPtr, Int_t module);
virtual void WriteHistogram(Char_t* fileName = "histogram.root");
- virtual void Analyze(AliHLTPHOSClusterDataStruct* clustersPtr[10000], Int_t nClusters) = 0;
+
+ /**
+ * Abstract function, for doing analysis
+ * @param recPointsPtr is an array of pointers to recPoints
+ * @param nRecPoints is the numbers of recPoints
+ */
+ virtual void Analyze(AliHLTPHOSRecPointDataStruct* recPointsPtr[10000], Int_t nRecPoints) = 0;
protected:
-
- TObjArray* fClustersPtr; //! /**<Pointer to the clusters to be analyzed*/
- TH1F* fRootHistPtr; //! /**<Pointer to the histograms which is to be filled*/
+
+ /** Pointer to the clusters to be analyzed */
+ TObjArray* fRecPointsPtr; //! transient
+
+ /** Pointer to the histograms which is to be filled */
+ TH1F* fRootHistPtr; //! transient
private:
- Float_t fRotParametersCos[5]; /**<Parameters for calculating global position*/
- Float_t fRotParametersSin[5]; /**<Parameters for calculating global position*/
- Float_t fPHOSRadius; /**<Distance from the IP to the crystals*/
+
+ /** Parameters for calculating global position */
+ Float_t fRotParametersCos[5];
+
+ /** Parameters for calculating global position */
+ Float_t fRotParametersSin[5];
+
+ /** Distance from the IP to the crystals */
+ Float_t fPHOSRadius;
ClassDef(AliHLTPHOSPhysicsAnalyzer,1);
};
-
/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
* *
- * Authors: Øystein Djuvsland <oysteind@ift.uib.no> *
+ * Primary Authors: Oystein Djuvsland *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
+ * about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * Class does fitting on an histogram
+ *
+ * @file AliHLTPHOSPhysicsAnalyzerPeakFitter.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Fitter for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include <Riostream.h>
#include "AliHLTPHOSPhysicsAnalyzerPeakFitter.h"
Int_t maxBin = fRootHistPtr->GetMaximumBin();
Float_t binWidth = fRootHistPtr->GetBinWidth(maxBin);
Float_t maxBinValue = (Float_t)(maxBin * binWidth);
- Float_t lowRange = maxBinValue - 0.03;
- Float_t highRange = maxBinValue + 0.03;
+ Float_t lowRange = maxBinValue - 0.05;
+ Float_t highRange = maxBinValue + 0.05;
TF1* gaussian = new TF1("gaussian", "gaus", 0.1, 0.2);
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
#ifndef ALIHLTPHOSPHYSICSANALYZERPEAKFITTER_H
#define ALIHLTPHOSPHYSICSANALYZERPEAKFITTER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
+/**
+ * Class does fitting on an histogram
+ *
+ * @file AliHLTPHOSPhysicsAnalyzerPeakFitter.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Fitter for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "Rtypes.h"
-#include "AliHLTPHOSClusterDataStruct.h"
+//#include "AliHLTPHOSClusterDataStruct.h"
#include "AliHLTDataTypes.h"
#include "TH1F.h"
#include "TMath.h"
-
+/**
+ * @class AliHLTPHOSPhysicsAnalyzerPeakFitter
+ * Fitter for PHOS HLT
+ * Makes a fit on a histogram, either a Lorentzian fit or
+ * Gaussian fit
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSPhysicsAnalyzerPeakFitter
{
public:
+ /** Constructor */
AliHLTPHOSPhysicsAnalyzerPeakFitter();
+
+ /** Destructor */
virtual ~AliHLTPHOSPhysicsAnalyzerPeakFitter();
+
+ /** Copy constructor */
AliHLTPHOSPhysicsAnalyzerPeakFitter(const AliHLTPHOSPhysicsAnalyzerPeakFitter &);
+
+ /** Assignment operator */
AliHLTPHOSPhysicsAnalyzerPeakFitter & operator = (const AliHLTPHOSPhysicsAnalyzerPeakFitter &) {return *this;}
+ /** Set histogram */
void SetHistogram(TH1F* histPtr) { fRootHistPtr = histPtr; }
+ /** Fit with a gaussian */
Int_t FitGaussian();
+
+ /** Fit with a lorentzian */
Int_t FitLorentzian();
private:
- Float_t fGainLow;
- Float_t fGainHigh;
- TH1F* fRootHistPtr;
+ /** Factor for low gain */
+ Float_t fGainLow; //COMMENT
+
+ /** Factor for high gain */
+ Float_t fGainHigh; //COMMENT
+
+ /** Pointer to the ROOT histogram */
+ TH1F* fRootHistPtr; //! transient
ClassDef(AliHLTPHOSPhysicsAnalyzerPeakFitter, 1);
/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
* *
- * Authors: Øystein Djuvsland <oysteind@ift.uib.no> *
+ * Primary Authors: Oystein Djuvsland *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
+ * about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * @file AliHLTPHOSPhysicsAnalyzerSpectrum.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Invariant mass spectrum from 2 gammas */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSPhysicsAnalyzerSpectrum.h"
-#include "AliHLTPHOSClusterDataStruct.h"
+#include "AliHLTPHOSRecPointDataStruct.h"
#include <cmath>
#include "math.h"
#include "TH1F.h"
AliHLTPHOSPhysicsAnalyzerSpectrum::AliHLTPHOSPhysicsAnalyzerSpectrum():AliHLTPHOSPhysicsAnalyzer(), fPos0Ptr(0), fPos1Ptr(0), fThresholdPtr(0), fEnergyPtr(0)
{
//Constructor
-
+ //See header file for documentation
fEnergyPtr = new Float_t[2];
fPos0Ptr = new Float_t[3];
fPos1Ptr = new Float_t[3];
AliHLTPHOSPhysicsAnalyzerSpectrum::AliHLTPHOSPhysicsAnalyzerSpectrum(const AliHLTPHOSPhysicsAnalyzerSpectrum &):AliHLTPHOSPhysicsAnalyzer(), fPos0Ptr(0), fPos1Ptr(0), fThresholdPtr(0), fEnergyPtr(0)
{
//Copy constructor not implemented
+ //See header file for documentation
}
AliHLTPHOSPhysicsAnalyzerSpectrum::~AliHLTPHOSPhysicsAnalyzerSpectrum()
{
//Destructor
-
- if(fClustersPtr) fClustersPtr = 0;
+ //See header file for documentation
+ if(fRecPointsPtr) fRecPointsPtr = 0;
if(fRootHistPtr) fRootHistPtr = 0;
}
void
-AliHLTPHOSPhysicsAnalyzerSpectrum::Analyze(AliHLTPHOSClusterDataStruct* clustersPtr[10000], Int_t nClusters)
+AliHLTPHOSPhysicsAnalyzerSpectrum::Analyze(AliHLTPHOSRecPointDataStruct* recPointsPtr[10000], Int_t nRecPoints)
{
- //Analyzing a set of clusters
-
+ //Analyzing a set of recPoints
+ //See header file for documentation
Float_t cosOpeningAngle = 0;
- if(nClusters > 1)
+ if(nRecPoints > 1)
{
- for(Int_t i = 0; i < nClusters-1; i++)
+ for(Int_t i = 0; i < nRecPoints-1; i++)
{
- fEnergyPtr[0] = clustersPtr[i]->fClusterEnergy;
+ fEnergyPtr[0] = recPointsPtr[i]->fAmp;
if(fEnergyPtr[0] > fThresholdPtr[0])
{
- for(Int_t j = i+1; j < nClusters; j++)
+ for(Int_t j = i+1; j < nRecPoints; j++)
{
- fEnergyPtr[1] = clustersPtr[j]->fClusterEnergy;
+ fEnergyPtr[1] = recPointsPtr[j]->fAmp;
if(fEnergyPtr[1] > fThresholdPtr[1])
{
- GlobalPosition(clustersPtr[i], fPos0Ptr);
+ GlobalPosition(recPointsPtr[i], fPos0Ptr);
- GlobalPosition(clustersPtr[j], fPos1Ptr);
+ GlobalPosition(recPointsPtr[j], fPos1Ptr);
cosOpeningAngle = (fPos0Ptr[0]*fPos1Ptr[0] + fPos0Ptr[1]*fPos1Ptr[1] + fPos0Ptr[2]*fPos1Ptr[2])/
(sqrt(fPos0Ptr[0]*fPos0Ptr[0] + fPos0Ptr[1]*fPos0Ptr[1] + fPos0Ptr[2]*fPos0Ptr[2])*
sqrt(fPos1Ptr[0]*fPos1Ptr[0] + fPos1Ptr[1]*fPos1Ptr[1] + fPos1Ptr[2]*fPos1Ptr[2]));
fRootHistPtr->Fill(sqrt(2*fEnergyPtr[0]*fEnergyPtr[1]*(1 - cosOpeningAngle)));
-
-
}
}
Float_t
AliHLTPHOSPhysicsAnalyzerSpectrum::EvalDistance()
{
- //Evaluate the distance between the two clusters
-
+ //Evaluate the distance between the two recPoints
+ //See header file for documentation
if(fPos0Ptr && fPos1Ptr)
return sqrt(pow(fPos1Ptr[0]-fPos0Ptr[0],2) + pow(fPos1Ptr[1]-fPos0Ptr[1],2) + pow(fPos1Ptr[2]-fPos0Ptr[2],2));
return -1;
AliHLTPHOSPhysicsAnalyzerSpectrum::SetThreshold(Float_t photonEnergy0, Float_t photonEnergy1)
{
//Setting the cut thresholds
-
+ //See header file for documentation
fThresholdPtr[0] = photonEnergy0;
fThresholdPtr[1] = photonEnergy1;
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+/**
+ * @file AliHLTPHOSPhysicsAnalyzerSpectrum.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Invariant mass spectrum from 2 gammas */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#ifndef ALIHLTPHOSPHYSICSANALYZERSPECTRUM_H
#define ALIHLTPHOSPHYSICSANALYZERSPECTRUM_H
#include "AliHLTPHOSPhysicsAnalyzer.h"
#include "Rtypes.h"
+/**
+ * @class AliHLTPHOSPhysicsAnalyzerSpectrum
+ * Invariant mass spectrum from 2 gammas
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSPhysicsAnalyzerSpectrum : public AliHLTPHOSPhysicsAnalyzer
{
public:
+
+ /** Constructor */
AliHLTPHOSPhysicsAnalyzerSpectrum();
+
+ /** Copy constructor */
AliHLTPHOSPhysicsAnalyzerSpectrum(const AliHLTPHOSPhysicsAnalyzerSpectrum &);
+ /*
AliHLTPHOSPhysicsAnalyzerSpectrum & operator = (const AliHLTPHOSPhysicsAnalyzerSpectrum)
{
return *this;
}
+ */
+ /** Destructor */
virtual ~AliHLTPHOSPhysicsAnalyzerSpectrum();
+ /** Set the threshold for the 2 photon energies */
Int_t SetThreshold(Float_t photonEnergy0, Float_t photonEnergy1);
+
+ /**
+ * Evaluate the distance between 2 rec points
+ * @return the distance
+ */
Float_t EvalDistance();
- virtual void Analyze(AliHLTPHOSClusterDataStruct* clustersPtr[10000], Int_t nClusters);
+ /**
+ * Analyze the event
+ * @param recPointsPtr is an array of pointers to rec points in the event
+ * @param nRecPoints is the number of rec points in the event
+ */
+ virtual void Analyze(AliHLTPHOSRecPointDataStruct* recPointsPtr[10000], Int_t nRecPoints);
private:
- Float_t* fPos0Ptr; //! /**<Position of the first cluster*/
- Float_t* fPos1Ptr; //! /**</Position of the second cluster*/
- Float_t* fThresholdPtr; //! /**<Cut thresholds*/
- Float_t* fEnergyPtr; //! /**<Energy of the clusters*/
+ /** Position of the first cluster */
+ Float_t* fPos0Ptr; //! transient
+
+ /** Position of the second cluster */
+ Float_t* fPos1Ptr; //! transient
+
+ /** Cut thresholds */
+ Float_t* fThresholdPtr; //! transient
+
+ /** Energy of the clusters */
+ Float_t* fEnergyPtr; //! transient
ClassDef(AliHLTPHOSPhysicsAnalyzerSpectrum, 1);
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
- * Authors: Ã\98ystein Djuvsland <oysteind@ift.uib.no> *
+ * Authors: Oystein Djuvsland <oysteind@ift.uib.no> *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
#include "AliHLTPHOSPhysicsAnalyzerSpectrumComponent.h"
#include "AliHLTPHOSPhysicsAnalyzerPeakFitter.h"
//#include "AliHLTPHOSPhysicsDefinitions.h"
+#include "AliHLTPHOSDefinitions.h"
#include "AliHLTPHOSPhysicsAnalyzerSpectrum.h"
#include "AliHLTPHOSPhysicsAnalyzerSpectrumComponent.h"
+#include "AliHLTPHOSRecPointDataStruct.h"
//#include "Rtypes.h"
-class AliHLTPHOSDefinitions;
+/** @file AliHLTPHOSPhysicsAnalyzerSpectrumComponent.cxx
+ @author Oystein Djuvsland
+ @date
+ @brief An invariant mass spectrum component for PHOS HLT
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+//class AliHLTPHOSDefinitions;
const AliHLTComponentDataType AliHLTPHOSPhysicsAnalyzerSpectrumComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
UInt_t AliHLTPHOSPhysicsAnalyzerSpectrumComponent::fgCount = 0;
if(fPeakFitter)
{
fPeakFitter->SetHistogram(fRootHistPtr);
- fPeakFitter->FitLorentzian();
+ fPeakFitter->FitGaussian();
delete fPeakFitter;
fPeakFitter = 0;
}
if(fAnalyzerPtr)
{
+ fAnalyzerPtr->WriteHistogram("~/hist_fin.root");
delete fAnalyzerPtr;
fAnalyzerPtr = 0;
}
return 0;
}
-Int_t
-AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoDeinit()
-{
- //Deinitialize the component
- Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSPhysicsAnalyzerSpectrumComponent DoDeinit");
-
- return 0;
-}
-
-
const Char_t*
AliHLTPHOSPhysicsAnalyzerSpectrumComponent::GetComponentID()
{
}
-//Int_t
-//AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
-// AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t& /*size*/,
-// std::vector<AliHLTComponentBlockData>& /*outputBlocks*/)
-//{
+Int_t
+AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
+ AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
+ std::vector<AliHLTComponentBlockData>& outputBlocks)
+{
//Do event
- /*
+
const AliHLTComponentBlockData* iter = NULL;
unsigned long ndx;
{
iter = blocks+ndx;
- if(iter->fDataType != AliHLTPHOSPhysicsDefinitions::fgkAliHLTClusterDataType)
+ if(iter->fDataType != AliHLTPHOSDefinitions::fgkAliHLTRecPointDataType)
{
cout << "Warning: data type is not fgkAliHLTClusterDataType " << endl;
continue;
}
- fClusterArrayPtr[ndx] = reinterpret_cast<AliHLTPHOSClusterDataStruct*>(iter->fPtr);
+ fRecPointArrayPtr[ndx] = reinterpret_cast<AliHLTPHOSRecPointDataStruct*>(iter->fPtr);
}
- fAnalyzerPtr->Analyze(fClusterArrayPtr, ndx);
+ fAnalyzerPtr->Analyze(fRecPointArrayPtr, ndx);
if(fgCount%fWriteInterval == 0 && fgCount != 0)
{
// PushBack(fRootHistPtr, kAliHLTAnyDataType, (AliHLTUInt32_t)0);
+ fAnalyzerPtr->WriteHistogram("~/hist.root");
}
fgCount++;
- // if(fgCount%100==0)
- // {
- // printf("fgCount: %d\n\n", fgCount);
- cout << "fgCount: " << fgCount << endl;
- // }
+ if(fgCount%100==0)
+ {
+ cout << "fgCount: " << fgCount << endl;
+ }
return 0;
}
-*/
-int
-AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoEvent(const AliHLTComponentEventData &/*evtData*/, AliHLTComponentTriggerData &/*trigData*/)
+
+//int
+//AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoEvent(const AliHLTComponentEventData &/*evtData*/, AliHLTComponentTriggerData &/*trigData*/)
+/*
{
const AliHLTComponentBlockData* iter = NULL;
int ndx = 0;
return 0;
}
+*/
+
Int_t
AliHLTPHOSPhysicsAnalyzerSpectrumComponent::DoInit(int argc, const char** argv )
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-//Component for create an invariant mass spectrum for pi0's
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: Oystein Djuvsland *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
#ifndef ALIHLTPHOSPHYSICSANALYZERSPECTRUMCOMPONENT_H
#define ALIHLTPHOSPHYSICSANALYZERSPECTRUMCOMPONENT_H
+/**
+ * Invariant mass spectrum component for PHOS HLT
+ *
+ * @file AliHLTPHOSPhysicsAnalyzerSpectrumComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief An invariant mass spectrum component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
// removed PTH#include "AliHLTProcessor.h"
#include "AliHLTPHOSProcessor.h" // added by PTH
#include "AliHLTPHOSBase.h"
class TH1F;
class AliHLTPHOSPhysicsAnalyzerSpectrum;
class AliHLTPHOSPhysicsAnalyzerPeakFitter;
-class Rtypes;
class AliHLTPHOSDefinitions;
-class AliHLTPHOSPhysicsDefinitions;
class TFile;
-
-struct AliHLTPHOSClusterDataStruct;
-
-
+class AliHLTPHOSRecPointDataStruct;
+
+/**
+ * @class AliHLTPHOSClusterizerComponent
+ *
+ * Class for making an invariant mass spectrum histogram from 2 gammas.
+ * Takes as input AliHLTPHOSRecPointContainerStruct
+ *
+ *
+ * @ingroup alihlt_phos
+ */
// PTH class AliHLTPHOSPhysicsAnalyzerSpectrumComponent: public AliHLTPHOSBase, public AliHLTProcessor
class AliHLTPHOSPhysicsAnalyzerSpectrumComponent: public AliHLTPHOSProcessor // added by PTH
{
public:
+ /** Constructor */
AliHLTPHOSPhysicsAnalyzerSpectrumComponent();
+
+ /** Destructor */
~AliHLTPHOSPhysicsAnalyzerSpectrumComponent();
// PTH AliHLTPHOSPhysicsAnalyzerSpectrumComponent(const AliHLTPHOSPhysicsAnalyzerSpectrumComponent &);
// {
// return *this;
// }
+
+ /** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
+
+ /** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
- /*
+ /** interface function, see @ref AliHLTComponent for description */
Int_t DoEvent(const AliHLTComponentEventData&, const AliHLTComponentBlockData*,
AliHLTComponentTriggerData&, AliHLTUInt8_t*, AliHLTUInt32_t&,
- std::vector<AliHLTComponentBlockData>&);*/
+ std::vector<AliHLTComponentBlockData>&);
+ /** interface function, see @ref AliHLTComponent for description */
+ /*
int DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+ */
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
protected:
+ /** interface function, see @ref AliHLTComponent for description */
Int_t DoInit(int argc, const char** argv);
+
+ /** interface function, see @ref AliHLTComponent for description */
Int_t Deinit();
- Int_t DoDeinit();
- using AliHLTPHOSProcessor::DoEvent;
+
+ // using AliHLTPHOSProcessor::DoEvent;
private:
- AliHLTPHOSPhysicsAnalyzerSpectrum* fAnalyzerPtr; //! /**<Pointer to spectrum analyzer*
- AliHLTPHOSPhysicsAnalyzerPeakFitter* fPeakFitter; //! /**<Pointer to peak fitter*/
- TH1F* fRootHistPtr; //! /**<Pointer to histogram*/
- AliHLTPHOSClusterDataStruct* fClusterArrayPtr[10000]; //! /**<Pointer to array of clusters*/
- Int_t fWriteInterval; /**<Interval for writing to disk*/
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; /**<Data types*/
- static UInt_t fgCount; /**<Event count*/
+ /** Pointer to spectrum analyzer */
+ AliHLTPHOSPhysicsAnalyzerSpectrum* fAnalyzerPtr; //! transient
+
+ /** Pointer to peak fitter */
+ AliHLTPHOSPhysicsAnalyzerPeakFitter* fPeakFitter; //! transient
+
+ /** Pointer to histogram */
+ TH1F* fRootHistPtr; //! transient
+
+ /** Pointer to array of clusters */
+ AliHLTPHOSRecPointDataStruct* fRecPointArrayPtr[10000]; //! transient
+
+ /** Interval for writing to disk */
+ Int_t fWriteInterval; //COMMENT
+
+ /** Data types */
+ static const AliHLTComponentDataType fgkInputDataTypes[]; // COMMENT
+
+ /** Event count */
+ static UInt_t fgCount; //COMMENT
};
#endif
continue;
}
+ else
+ {
+ // cout << "Info, fDataSize = " << fAltroDataPtr->GetDataSize() << endl;
+ }
+
crazyness = fSanityInspectorPtr->CheckInsanity(fAltroDataPtr->GetData(), fAltroDataPtr->GetDataSize() - 2);
fAnalyzerPtr->SetData(fAltroDataPtr->GetData());
#ifndef ALIHLTPHOSRECPOINTCOINTAINERSTRUCT_H
#define ALIHLTPHOSRECPOINTCOINTAINERSTRUCT_H
+/**
+ * Rec point container struct for PHOS HLT
+ *
+ * @file AliHLTPHOSRecPointContainerStruct.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Rec point container struct for PHOS HLT
+ */
#include "AliHLTPHOSRecPointDataStruct.h"
+/**
+ * @struct AliHLTPHOSRecPointContainerStruct
+ * Rec point container struct for PHOS HLT
+ *
+ * @ingroup alihlt_phos
+ */
struct AliHLTPHOSRecPointContainerStruct
{
+
+ /** The PHOS module number */
UInt_t fPHOSModule;
+
+ /** The number of rec points */
UInt_t fNRecPoints;
+
+ /** Array of rec points in the container */
AliHLTPHOSRecPointDataStruct fRecPointArray[1000];
+
};
#endif
#ifndef ALIHLTPHOSRECPOINTDATASTRUCT_H
#define ALIHLTPHOSRECPOINTDATASTRUCT_H
+/**
+ * Rec point data struct for PHOS HLT
+ *
+ * @file AliHLTPHOSRecPointDataStruct.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Rec point data struct for PHOS HLT
+ */
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
//struct AliHLTPHOSDigitDataStruct;
#include "AliHLTPHOSDigitDataStruct.h"
//#include "AliHLTTypes.h"
+
+/**
+ * @struct AliHLTPHOSRecPointDataStruct
+ * Rec point data struct for PHOS HLT
+ *
+ * @ingroup alihlt_phos
+ */
struct AliHLTPHOSRecPointDataStruct
{
//AliHLTUInt8_t fMultiplicity;
- UInt_t fMultiplicity;
- Float_t fX;
- Float_t fZ;
- Float_t fAmp;
- Float_t fM2x;
- Float_t fM2z;
- Float_t fM3x;
- Float_t fM4z;
- Float_t fPhixe;
- Float_t fDistanceToBadChannel;
- AliHLTPHOSDigitDataStruct fDigitsList[64];
+ /** Multiplicity of digits in the rec point */
+ UInt_t fMultiplicity; //COMMENT
+
+ /** x coordinate */
+ Float_t fX; //COMMENT
+
+ /** z coordinate */
+ Float_t fZ; //COMMENT
+
+ /** Module number */
+ Float_t fModule; //COMMENT
+
+ /** The total energy of the rec point */
+ Float_t fAmp; //COMMENT
+
+ /** Second moment along x axis */
+ Float_t fM2x; //COMMENT
+
+ /** Second moment along z axis */
+ Float_t fM2z; //COMMENT
+
+ /** Third moment along x axis */
+ Float_t fM3x; //COMMENT
+
+ /** Fourth moment along z axis */
+ Float_t fM4z; //COMMENT
+
+ /** Angle between cog vector and eigen vector */
+ Float_t fPhixe; //COMMENT
+
+ /** Distance to nearest bad channel */
+ Float_t fDistanceToBadChannel; //COMMENT
+
+ /** Array of digits in the rec point */
+ AliHLTPHOSDigitDataStruct fDigitsList[64]; //COMMENT
};
+++ /dev/null
-#ifndef ALIHLTPHOSRECPOINTLISTDATASTRUCT_H
-#define ALIHLTPHOSRECPOINTLISTDATASTRUCT_H
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Authors: Øystein Djuvsland <oysteind@ift.uib.no> *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-struct AliHLTPHOSRecPointListDataStruct
-{
- int fX;
- int fZ;
- int fModule;
-};
-
-#endif
+++ /dev/null
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-#include "AliHLTPHOSSandboxComponent.h"
-#include "AliHLTPHOSProcessor.h"
-#include "AliHLTPHOSChannelCounter.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSDefinitions.h"
-
-const AliHLTComponentDataType AliHLTPHOSSandboxComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
-AliHLTPHOSSandboxComponent gAliHLTPHOSSandboxComponent;
-
-AliHLTPHOSSandboxComponent::AliHLTPHOSSandboxComponent() :
- AliHLTPHOSProcessor(),
- fEvtCnt(0),
- fChannelCounterPtr(0)
-{
- //comment
-}
-
-AliHLTPHOSSandboxComponent::~AliHLTPHOSSandboxComponent()
-{
- //comment
-}
-/*
-AliHLTPHOSSandboxComponent::AliHLTPHOSSandboxComponent(const AliHLTPHOSSandboxComponent &) :
- AliHLTDataSink(),
- fEvtCnt(0),
- fChannelCounterPtr(0)
-{
-
- //Copy constructor, not implemented
-
-}
-*/
-
-int
-AliHLTPHOSSandboxComponent::Deinit()
-{
- //comment
- printf("AliHLTPHOSSandboxComponent::Deinit()\n");
-
- //fChannelCounterPtr->PrintOutOfSyncChannels(fEvtCnt);
- fChannelCounterPtr->FillHistograms(fEvtCnt);
- fChannelCounterPtr->WriteHistograms("/opt/HLT-public/rundir/channelcount.root");
- return 0;
-}
-
-Int_t
-AliHLTPHOSSandboxComponent::DoDeinit()
-{
- //comment
- //Deinitialize the component
- Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSSandboxComponent DoDeinit");
-
- return 0;
-}
-
-
-
-const char*
-AliHLTPHOSSandboxComponent::GetComponentID()
-{
- //comment
- return "PhosSandbox";
-}
-
-void
-AliHLTPHOSSandboxComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
-{
- //Get datatypes for input
- const AliHLTComponentDataType* pType=fgkInputDataTypes;
- while (pType->fID!=0) {
- list.push_back(*pType);
- pType++;
- }
-}
-
-AliHLTComponentDataType
-AliHLTPHOSSandboxComponent::GetOutputDataType()
-{
- //comment
- return AliHLTPHOSDefinitions::fgkAliHLTSandboxDataType;
-}
-
-
-void
-AliHLTPHOSSandboxComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
-{
- //comment
- constBase = 30;
- inputMultiplier = 1;
-}
-
-/*
-int
-AliHLTPHOSSandboxComponent::DoProcessing(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- vector<AliHLTComponentBlockData>& outputBlocks, AliHLTComponentEventDoneData *& edd)
-*/
-int
-AliHLTPHOSSandboxComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t& /*size*/, //TODO: I think size should be set to zero when returning from this method if not data was written to the output buffer.
- vector<AliHLTComponentBlockData>& /*outputBlocks*/)
-{
- //Do event
-
-
- const AliHLTComponentBlockData* iter = 0;
- unsigned long ndx;
-
- for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
- {
- iter = blocks+ndx;
-
- if(iter->fDataType != AliHLTPHOSDefinitions::fgkCellEnergyDataType)
- {
- // cout << "Warning: data type is not fgkCellEnergyDataType " << endl;
- continue;
- }
- // cout << "Data type is fgkCellEnergyDataType\n";
- fChannelCounterPtr->CountChannels(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
- }
-
- fEvtCnt++;
-
- if(fEvtCnt % 10 == 0)
- {
- printf("Event #: %d\n", fEvtCnt);
- //fChannelCounterPtr->PrintOutOfSyncChannels(fEvtCnt);
- }
-
- if(fEvtCnt % 1000 == 0 && fEvtCnt != 0)
- {
-// fChannelCounterPtr->PrintOutOfSyncChannels(fEvtCnt);
- fChannelCounterPtr->FillHistograms(fEvtCnt);
- fChannelCounterPtr->WriteHistograms("/opt/HLT-public/rundir/channelcount.root");
- }
-
- //cout << "Doing event... \n";
- return 0;
-}
-
-
-int
-AliHLTPHOSSandboxComponent::DoInit(int argc, const char** /*argv*/ )
-{
- //Do initialization
-
- fChannelCounterPtr = new AliHLTPHOSChannelCounter();
-
- for(int i = 0; i < argc; i++)
- {
- /*
- */
- }
-
- return 0;
-}
-
-AliHLTComponent*
-AliHLTPHOSSandboxComponent::Spawn()
-{
- //comment
- return new AliHLTPHOSSandboxComponent();
-}
+++ /dev/null
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Authors: Oystein Djuvsland *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-#ifndef ALIHLTPHOSSANDBOXCOMPONENT
-#define ALIHLTPHOSSANDBOXCOMPONENT
-
-//#include "AliHLTPHOSChannelCounter.h"
-//#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSProcessor.h"
-
-class AliHLTPHOSChannelCounter;
-class AliHLTPHOSRcuCellEnergyDataStruct;
-
-class AliHLTPHOSSandboxComponent : public AliHLTPHOSProcessor
-{
-public:
- AliHLTPHOSSandboxComponent();
- virtual ~AliHLTPHOSSandboxComponent();
-
-
- /* AliHLTPHOSSandboxComponent(const AliHLTPHOSSandboxComponent &);
- AliHLTPHOSSandboxComponent & operator = (const AliHLTPHOSSandboxComponent &)
- {
- return *this;
- }*/
-
- const char* GetComponentID();
-
- void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
-
- AliHLTComponentDataType GetOutputDataType();
-
- void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-
- /*
- int DoProcessing(const AliHLTComponentEventData&, const AliHLTComponentBlockData*,
- AliHLTComponentTriggerData&, AliHLTUInt8_t*, AliHLTUInt32_t&,
- std::vector<AliHLTComponentBlockData>&, AliHLTComponentEventDoneData *&);
- */
- int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- std::vector<AliHLTComponentBlockData>& outputBlocks);
-
- AliHLTComponent* Spawn();
-
-protected:
-
- using AliHLTPHOSProcessor::DoEvent;
-
- int DoInit(int argc, const char** argv);
- virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
-
- virtual int DoDeinit();
-
-private:
-
- Int_t fEvtCnt; //comment
- AliHLTPHOSChannelCounter *fChannelCounterPtr; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
-};
-#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * @file AliHLTPHOSSanityInspector.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Sanity inspector for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#include "AliHLTPHOSSanityInspector.h"
#include "Rtypes.h"
AliHLTPHOSBase(),
fMaxDifference(120)
{
- //comment
+ //See header file for documentation
}
AliHLTPHOSSanityInspector::~AliHLTPHOSSanityInspector()
{
- //comment
+ //See header file for documentation
}
const Int_t
AliHLTPHOSSanityInspector::CheckInsanity(const UInt_t* data, const Int_t N) const
{
- //comment
+ //See header file for documentation
+
for(Int_t i = 1; i < N; i++)
{
if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
return 0;
}
+/*
+Int_t
+AliHLTPHOSSanityInspector::CheckInsanity(Int_t* data, Int_t N)
+{
+ //See header file for documentation
+ for(Int_t i = 1; i < N; i++)
+ {
+ if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
+ return 1;
+ }
+ return 0;
+}
+*/
Int_t
AliHLTPHOSSanityInspector::CheckAndHealInsanity(UInt_t* data, Int_t N)
//
{
- //comment
+ //See header file for documentation
+
Int_t crazyness = 0;
if(N > 3)
Int_t
AliHLTPHOSSanityInspector::CheckAndHealInsanity(Int_t* data, Int_t N)
{
- //comment
+ //See header file for documentation
+
Int_t crazyness = 0;
if(N > 3)
#ifndef ALIHLTPHOSSANITYINSPECTOR_H
#define ALIHLTPHOSSANITYINSPECTOR_H
+/**
+ * Class checks data for insanity
+ * for use in HLT, but can also be used offline
+ *
+ * @file AliHLTPHOSSanityInspector.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Sanity inspector for PHOS HLT
+ */
+
#include "AliHLTPHOSBase.h"
#include "Rtypes.h"
+
+class AliHLTAltroData;
+
+/**
+ * @class AliHLTPHOSSanityInspector
+ * Sanity inspector for PHOS HLT. It takes raw data as input and checks it for insanity
+ * It will then flag it.
+ *
+ * @ingroup alihlt_phos
+ */
+
class AliHLTPHOSSanityInspector : public AliHLTPHOSBase
{
public:
+
+ /** Constructor */
AliHLTPHOSSanityInspector();
+
+ /* Destructor */
virtual ~AliHLTPHOSSanityInspector();
+
+ // Int_t CheckInsanity(UInt_t* data, Int_t nSamples);
+
+
+ // Int_t CheckInsanity(Int_t* data, Int_t nSamples);
+
+
+
+ /** Check for insanity */
const Int_t CheckInsanity(const UInt_t* data, const Int_t nSamples) const;
+
+ /** Check for and heal insanity */
Int_t CheckAndHealInsanity(UInt_t* data, Int_t nSamples); //Not completely reliable
+
+ /** Check for and heal insanity */
Int_t CheckAndHealInsanity(Int_t* data, Int_t nSamples); //Not completely reliable
+
+ /** Set the max difference between 2 samples before flagging insanity */
void SetMaxDifference(Int_t maxDiff) { fMaxDifference = maxDiff; }
private:
- Int_t fMaxDifference; //comment
+
+ /** The max difference between 2 samples */
+ Int_t fMaxDifference; //COMMENT
ClassDef(AliHLTPHOSSanityInspector, 1);
};
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/**
+ * @file AliHLTPHOSTreeMaker.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Tree maker for PHOS HLT
+ */
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSTreeMaker.h"
#include "AliHLTPHOSBase.h"
fDigitArrayPtr(0),
fDigitTreePtr(0)
{
-
+ //See header file for documentation
fDigitArrayPtr = new TClonesArray("AliHLTPHOSDigit", 300); //!!!!!!!!!!!!!!!!
fDigitTreePtr = new TTree("digitTree", "Digits Tree");
AliHLTPHOSTreeMaker::~AliHLTPHOSTreeMaker()
{
-
+ //See header file for documentation
}
Int_t
AliHLTPHOSTreeMaker::MakeDigitArray(AliHLTPHOSDigitContainerDataStruct *digitContainer, Int_t nDigits)
{
+ //See header file for documentation
AliHLTPHOSDigit *digit = 0;
AliHLTPHOSDigitDataStruct *digitStruct = 0;
void
AliHLTPHOSTreeMaker::FillDigitTree()
{
+ //See header file for documentation
fDigitTreePtr->Fill();
fDigitArrayPtr->Clear();
}
void
AliHLTPHOSTreeMaker::SetDigitTree(TTree *tree)
{
+ //See header file for documentation
fDigitTreePtr = tree;
fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
}
#ifndef ALIHLTPHOSTREEMAKER_H
#define ALIHLTPHOSTREEMAKER_H
+/**
+ * Class makes tree of digits of the class AliHLTPHOSDigit
+ * stored in an TClonesArray
+ *
+ * @file AliHLTPHOSTreeMaker.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief Tree maker for PHOS HLT
+ */
+
#include "AliHLTPHOSBase.h"
#include "TTree.h"
class AliHLTPHOSDigitContainerDataStruct;
class TClonesArray;
//class TTree;
+
+/**
+ * @class AliHLTPHOSTreeMaker
+ * Tree maker for PHOS HLT. Takes AliHLTPHOSDigitContainerDataStruct as input,
+ * makes a TClonesArray of objecst of the class AliHLTPHOSDigit, and then makes
+ * a tree out of it.
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSTreeMaker : public AliHLTPHOSBase
{
public:
+ /** Constructor */
AliHLTPHOSTreeMaker();
+
+ /** Destructor */
~AliHLTPHOSTreeMaker();
+ /**
+ * Make a TClonesArray AliHLTPHOSDigits from a container of digit structs
+ * @param digitContainer is the container of digit structs
+ * @param nDigits is the number of digits in the container
+ * @return the number of digits
+ */
Int_t MakeDigitArray(AliHLTPHOSDigitContainerDataStruct* digitContainer, Int_t nDigits);
-
+ /** Fill the digit tree */
void FillDigitTree();
+ /** Reset the digit tree */
void ResetDigitTree() { fDigitTreePtr->Reset(); }
+ /** Set the digit tree */
void SetDigitTree(TTree* tree);
+ /**
+ * Get the digit tree
+ * @return a pointer to the tree
+ */
TTree* GetDigitTree() { return fDigitTreePtr; }
private:
- TClonesArray *fDigitArrayPtr;
- TTree* fDigitTreePtr;
+
+ /** The array of digit object */
+ TClonesArray *fDigitArrayPtr; //COMMENT
+
+ /** The digit tree */
+ TTree* fDigitTreePtr; //COMMENT
ClassDef(AliHLTPHOSTreeMaker, 1);
#include <sys/stat.h>
#include <sys/types.h>
+/**
+ * Tree maker component for PHOS HLT
+ *
+ * @file AliHLTPHOSTreeMakerComponent.cxx
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A tree maker component for PHOS HLT
+*/
+
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
const AliHLTComponentDataType AliHLTPHOSTreeMakerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
AliHLTPHOSTreeMakerComponent gAliHLTPHOSTreeMakerComponent;
AliHLTPHOSTreeMakerComponent::AliHLTPHOSTreeMakerComponent() :
AliHLTPHOSProcessor(),
fDigitTreePtr(0),
- // fEventCount(0),
+ fTreeMakerPtr(0),
+ fDirectory(0),
fWriteInterval(1000)
{
- //comment
+ //See header file for documentation
}
AliHLTPHOSTreeMakerComponent::~AliHLTPHOSTreeMakerComponent()
{
- //comment
+ //See header file for documentation
}
int
AliHLTPHOSTreeMakerComponent::Deinit()
{
- //comment
- cout << "Printing file...";
+ //See header file for documentation
+ cout << "Writing file...";
char filename [50];
- // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
-
- // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fEventCount/fWriteInterval));
- sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval));
-
-
+ sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval));
+
TFile *outfile = new TFile(filename,"recreate");
fDigitTreePtr->Write();
delete outfile;
const char*
AliHLTPHOSTreeMakerComponent::GetComponentID()
{
- //comment
+ //See header file for documentation
return "PhosTreeMaker";
}
void
AliHLTPHOSTreeMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
{
- //comment
+ //See header file for documentation
//Get datatypes for input
const AliHLTComponentDataType* pType=fgkInputDataTypes;
while (pType->fID!=0) {
AliHLTComponentDataType
AliHLTPHOSTreeMakerComponent::GetOutputDataType()
{
- //comment
+ //See header file for documentation
return AliHLTPHOSDefinitions::fgkAliHLTRootTreeDataType;
}
void
AliHLTPHOSTreeMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
{
- //comment
+ //See header file for documentation
constBase = 30;
inputMultiplier = 1;
}
{
//Do event
-
+ //See header file for documentation
Bool_t digitEvent;
Int_t nDigits = 0;
Int_t totalDigits = 0;
int
AliHLTPHOSTreeMakerComponent::DoInit ( int argc, const char** argv )
{
- //comment
+ //See header file for documentation
fTreeMakerPtr = new AliHLTPHOSTreeMaker();
fDigitTreePtr = new TTree ( "digitTree", "Digits tree" );
fDirectory = new char[50];
AliHLTComponent*
AliHLTPHOSTreeMakerComponent::Spawn()
{
- //comment
+ //See header file for documentation
return new AliHLTPHOSTreeMakerComponent();
}
void
AliHLTPHOSTreeMakerComponent::Write()
{
- //comment
+ //See header file for documentation
cout << "Writing file...";
char filename [256];
- // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
+
sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval - 1));
TFile *outfile = new TFile(filename,"recreate");
void
AliHLTPHOSTreeMakerComponent::ResetTrees()
{
- //comment
+ //See header file for documentation
delete fDigitTreePtr;
fDigitTreePtr = new TTree("digitTree", "Digits tree");
fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
}
-
-
+
#ifndef ALIHLTPHOSTREEMAKERCOMPONENT_H
#define ALIHLTPHOSTREEMAKERCOMPONENT_H
+/**
+ * Tree maker component for PHOS HLT
+ *
+ * @file AliHLTPHOSTreeMakerComponent.h
+ * @author Oystein Djuvsland
+ * @date
+ * @brief A tree maker component for PHOS HLT
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include "AliHLTPHOSProcessor.h"
class AliHLTPHOSTreeMaker;
class TTree;
+
+/**
+ * @class AliHLTPHOSTreeMakerComponent
+ *
+ * Class for making trees of digits in PHOS HLT
+ * Takes as input structs of type AliHLTPHOSDigitContainerStruct, and makes a
+ * tree of TClonesArrays of objects of type AliHLTPHOSDigit
+ *
+ * The component has the following component arguments:
+ * -path File name base
+ * -writeinterval How often to write to disk, in events
+ *
+ * @ingroup alihlt_phos
+ */
class AliHLTPHOSTreeMakerComponent : public AliHLTPHOSProcessor
{
public:
-
+
+ /** Constructor */
AliHLTPHOSTreeMakerComponent();
+
+ /** Destructor */
virtual ~AliHLTPHOSTreeMakerComponent();
+ /** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
+ /** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
void GetOutputDataSize(unsigned long& constBase, double& inputmultiplier);
+
/*
int DoEvent(const AliHLTComponentEventData&,
AliHLTComponentTriggerData&);
*/
-
+
+ /** interface function, see @ref AliHLTComponent for description */
int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t&size,
std::vector<AliHLTComponentBlockData>& outputBlocks);
-
+
+ /** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
+ /** Write the tree */
void Write();
+
+ /** Reset the trees */
void ResetTrees();
protected:
- using AliHLTPHOSProcessor::DoEvent;
+
+ /** interface function, see @ref AliHLTComponent for description */
int DoInit(int argc, const char** argv);
+ using AliHLTPHOSProcessor::DoEvent;
+
+ /** interface function, see @ref AliHLTComponent for description */
virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
private:
- AliHLTPHOSTreeMaker *fTreeMakerPtr; //comment
- TTree *fDigitTreePtr; //comment
- // UInt_t fEventCount; //comment
- UInt_t fWriteInterval; //comment
- // UInt_t fRunNb; //comment
- char *fDirectory; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
+
+ /** Pointer to a AliHLTPHOSTreeMaker object */
+ AliHLTPHOSTreeMaker *fTreeMakerPtr; //! transient
+
+ /** Pointer to the tree */
+ TTree *fDigitTreePtr; //! transient
+
+ /** Event count */
+ UInt_t fEvtCount; //COMMENT
+
+ /** Write interval */
+ UInt_t fWriteInterval; //COMMENT
+
+ /** Run number */
+ //UInt_t fRunNb; //COMMENT
+
+ /** Path to the directory where to write the tree */
+ char *fDirectory; //! transient
+
+ /** Framework variable */
+ static const AliHLTComponentDataType fgkInputDataTypes[]; //COMMENT
};
#endif
#pragma link C++ class AliHLTPHOSSanityInspector+;
#pragma link C++ class AliHLTPHOSBaselineAnalyzer+;
#pragma link C++ class AliHLTPHOSRcuTreeMaker+;
-#pragma link C++ class AliHLTPHOSChannelCounter+;
+
#endif