#include "AliRawReaderMemory.h"
#include "AliAltroRawStreamV3.h"
#include "TMath.h"
+#include "TH1.h"
+#include "TH2.h"
+#include "TFile.h"
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTAltroChannelSelectorComponent)
fStartTimeBin(0),
fEndTimeBin(1024),
fSignalThreshold(0),
- fRMSThreshold(0)
+ fRMSThreshold(0),
+ fMakeHistogram(false),
+ fhThreshold(NULL),
+ fhRMS(NULL)
{
// see header file for class documentation
// or
// -rms-threshold
} else if (argument.CompareTo("-rms-threshold")==0) {
if ((bMissingParam=(++i>=argc))) break;
- fRMSThreshold = strtoul( argv[i], &cpErr ,0);
+ fRMSThreshold = strtod( argv[i], &cpErr);
if ( *cpErr ) break;
- } else {
+ }
+ //-make-histogram
+ else if(argument.CompareTo("-make-histogram")==0){
+ fMakeHistogram=true;
+ }
+ else {
HLTError("unknown argument %s", argument.Data());
iResult=-EINVAL;
}
iResult=-EINVAL;
}
+ if(fMakeHistogram){
+ fhThreshold=new TH1F("fhThreshold","signal-threshold",1000,0,20);
+ if (fhThreshold) {
+ fhThreshold->Sumw2();
+ fhThreshold->GetXaxis()->SetTitle("MaxSignal - <Signal>");
+ }
+ fhRMS=new TH1F("fhRMS","rms-threshold",1000,0,10);
+ if (fhRMS) {
+ fhRMS->Sumw2();
+ fhRMS->GetXaxis()->SetTitle("MaxSignal/ #sqrt{<Signal^{2}>}");
+ }
+ }
+
return iResult;
}
int AliHLTAltroChannelSelectorComponent::DoDeinit()
{
// see header file for class documentation
+ if(fMakeHistogram){
+ std::auto_ptr<TFile> outFile(new TFile("CSHistos.root","recreate"));
+ if (outFile.get() && !outFile->IsZombie()) {
+ if (fhThreshold) fhThreshold->Write();
+ if (fhRMS) fhRMS->Write();
+ outFile->Write();
+ outFile->Close();
+ }
+ }
+ if (fhThreshold) delete fhThreshold;
+ if (fhRMS) delete fhRMS;
+ fhRMS=NULL;
+ fhThreshold=NULL;
return 0;
}
// search for the active pad information
AliHLTUInt16_t* pActiveHwAddressArray=NULL;
int iArraySize=0;
- if (fSignalThreshold==0 && fRMSThreshold==0) {
+ if (fSignalThreshold==0 && fabs(fRMSThreshold)<1E-4) {
for (int i=0; i<(int)evtData.fBlockCnt; i++ ) {
// search for selection data of hw address type
// which matches the data specification of the block
if (nofSignals==0 || maxSignal<=(sumSignals/nofSignals)+fSignalThreshold) {
continue;
}
+ if (fhThreshold) fhThreshold->Fill(maxSignal-(sumSignals/nofSignals));
- } else if (fRMSThreshold!=0) {
+ } else if (fabs(fRMSThreshold)>1E-4) {
// treshold by adc counts
unsigned int sumSignals=0;
unsigned int maxSignal=0;
if (nofSignals==0 || maxSignal<=TMath::Sqrt(sumSignals/nofSignals)*fRMSThreshold) {
continue;
}
-
+ if (fhRMS) fhRMS->Fill(maxSignal/TMath::Sqrt(sumSignals/nofSignals));
} else {
int active=0;
for (active=0; active<iArraySize; active++) {
#include "AliHLTProcessor.h"
+class TH1F;
+
/**
* @class AliHLTAltroChannelSelectorComponent
* A selector component for ALTRO Raw data. The component subscribes
unsigned int fStartTimeBin; //!transient
unsigned int fEndTimeBin; //!transient
unsigned int fSignalThreshold; //!transient
- unsigned int fRMSThreshold; //!transient
+ float fRMSThreshold; //!transient
+ bool fMakeHistogram; //!transient
+
+ TH1F *fhThreshold;//! Histgram of the "threshold value"
+ TH1F *fhRMS;//! Histgrams of the "RMS value"
- ClassDef(AliHLTAltroChannelSelectorComponent, 2);
+ ClassDef(AliHLTAltroChannelSelectorComponent, 0);
};
#endif