#include "AliFMDCalibStripRange.h"
#include "AliLog.h"
#include "AliRawEventHeaderBase.h"
+#include <TDatime.h>
+#include <TSystem.h>
//_____________________________________________________________________
ClassImp(AliFMDBaseDA)
UShort_t str,
Bool_t full) const
{
+ // Get the strip path
+ //
+ // Parameters
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // str Strip number
+ // full If true, return full path
+ //
+ // Return
+ // The path
return Form("%s%sFMD%d%c[%02d,%03d]",
(full ? GetSectorPath(det, ring, sec, full) : ""),
(full ? "/" : ""), det, ring, sec, str);
UShort_t sec,
Bool_t full) const
{
+ // Get the strip path
+ //
+ // Parameters
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // str Strip number
+ // full If true, return full path
+ //
+ // Return
+ // The path
return Form("%s%sFMD%d%c[%02d]",
(full ? GetRingPath(det, ring, full) : ""),
(full ? "/" : ""), det, ring, sec);
Char_t ring,
Bool_t full) const
{
+ // Get the strip path
+ //
+ // Parameters
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // str Strip number
+ // full If true, return full path
+ //
+ // Return
+ // The path
return Form("%s%sFMD%d%c",
(full ? GetDetectorPath(det, full) : ""),
(full ? "/" : ""), det, ring);
AliFMDBaseDA::GetDetectorPath(UShort_t det,
Bool_t full) const
{
+ // Get the strip path
+ //
+ // Parameters
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // str Strip number
+ // full If true, return full path
+ //
+ // Return
+ // The path
return Form("%s%sFMD%d",
(full ? fDiagnosticsFilename.Data() : ""),
(full ? ":/" : ""), det);
fPulseSize(10),
fPulseLength(10),
fRequiredEvents(0),
- fCurrentEvent(0)
+ fCurrentEvent(0),
+ fRunno(0)
{
//Constructor
- fSeenDetectors[0] = fSeenDetectors[1] = fSeenDetectors[2] = kFALSE;
+ fSeenDetectors[0] = fSeenDetectors[1] = fSeenDetectors[2] = kFALSE;
fDetectorArray.SetOwner();
+ Rotate("conditions.csv", 3);
fConditionsFile.open("conditions.csv");
}
//_____________________________________________________________________
fPulseSize(baseDA.fPulseSize),
fPulseLength(baseDA.fPulseLength),
fRequiredEvents(baseDA.fRequiredEvents),
- fCurrentEvent(baseDA.fCurrentEvent)
+ fCurrentEvent(baseDA.fCurrentEvent),
+ fRunno(baseDA.fRunno)
{
//Copy constructor
fSeenDetectors[0] = baseDA.fSeenDetectors[0];
reader->Reset();
-
+ fRunno = reader->GetRunNumber();
+
AliFMDRawReader* fmdReader = new AliFMDRawReader(reader,0);
TClonesArray* digitArray = new TClonesArray("AliFMDDigit",0);
//Write the conditions data to file
AliFMDParameters* pars = AliFMDParameters::Instance();
fConditionsFile.write(Form("# %s \n",pars->GetConditionsShuttleID()),14);
+ TDatime now;
+ fConditionsFile << "# This file created from run number " << fRunno
+ << " at " << now.AsString() << std::endl;
AliFMDCalibSampleRate* sampleRate = new AliFMDCalibSampleRate();
AliFMDCalibStripRange* stripRange = new AliFMDCalibStripRange();
}
//_____________________________________________________________________
-Int_t AliFMDBaseDA::GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) const {
-
+Int_t AliFMDBaseDA::GetHalfringIndex(UShort_t det, Char_t ring,
+ UShort_t board) const
+{
+ // Get the index corresponding to a half-ring
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifier
+ // board Board number
+ //
+ // Return
+ // Internal index of the board
UShort_t iring = (ring == 'I' ? 1 : 0);
Int_t index = (((det-1) << 2) | (iring << 1) | (board << 0));
return index-2;
}
+//_____________________________________________________________________
+void AliFMDBaseDA::Rotate(const char* base, int max) const
+{
+ //
+ // Rotate a set of files. base is the basic name of the files.
+ // If the file base.max exists it is removed.
+ // If the file base.n exists (where n < max) it is renamed to
+ // base.(n-1).
+ // If the file base exists, it is renamed to base.1
+ //
+ // Parameters:
+ // base Base name of the files
+ // max Maximum number to keep (minus one for the current).
+
+ // Note: TSystem::AccessPathName returns false if the condition is
+ // fulfilled!
+
+ // Check if we have base.max, and if so, remove it.
+ TString testName(Form("%s.%d", base, max));
+ if (!gSystem->AccessPathName(testName.Data()))
+ gSystem->Unlink(testName.Data());
+
+ // Loop down from max-1 to 1 and move files
+ for (int i = max-1; i >= 1; i--) {
+ testName = Form("%s.%d", base, i);
+ if (!gSystem->AccessPathName(testName.Data())) {
+ TString newName(Form("%s.%d", base, i+1));
+ gSystem->Rename(testName.Data(), newName.Data());
+ }
+ }
+
+ // If we have the file base, rename it to base.1
+ testName = Form("%s", base);
+ if (!gSystem->AccessPathName(testName.Data())){
+ TString newName(Form("%s.%d", base, 1));
+ gSystem->Rename(testName.Data(), newName.Data());
+ }
+}
//_____________________________________________________________________
class TDirectory;
class AliFMDRawReader;
-class AliFMDBaseDA: public TNamed {
-
+class AliFMDBaseDA: public TNamed
+{
public:
+ /**
+ * Constructor
+ *
+ */
AliFMDBaseDA() ;
+ /**
+ * Copy constructor
+ *
+ * @param baseDA
+ */
AliFMDBaseDA(const AliFMDBaseDA & baseDA) ;
// AliFMDBaseDA& operator = (const AliFMDBaseDA & baseDA) ;
-
+ /**
+ * Destructor
+ *
+ */
~AliFMDBaseDA() ;
-
+ /**
+ * Run this DA
+ *
+ * @param fmdReader Raw input reader
+ */
void Run(AliRawReader* fmdReader);
+ /**
+ * Set whether to save diagnostics
+ *
+ * @param save If true, will output diagnostics file
+ */
void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
+ /**
+ * Set the number of requried events
+ *
+ * @param nEvents Number of event we need
+ */
void SetRequiredEvents(Int_t nEvents) {fRequiredEvents = nEvents;}
+ /**
+ * Get the number of required events
+ *
+ *
+ * @return number of required events
+ */
Int_t GetRequiredEvents() const {return fRequiredEvents ;}
protected:
-
+ /**
+ * Initialize
+ *
+ */
virtual void Init() {};
+ /**
+ * Fill channels
+ *
+ */
virtual void FillChannels(AliFMDDigit* ) {};
+ /**
+ * Analyse a single strip result
+ *
+ */
virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t ) {};
+ /**
+ * Write header to output file
+ *
+ */
virtual void WriteHeaderToFile() {};
- virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t, UShort_t, UShort_t ) {};
+ /**
+ * Add a strip container
+ *
+ */
+ virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t,
+ UShort_t, UShort_t ) {};
+ /**
+ * End of event
+ *
+ */
virtual void FinishEvent() {};
+ /**
+ * End of run
+ *
+ */
virtual void Terminate(TFile* ) {};
-
+ /**
+ * Current event number
+ *
+ *
+ * @return
+ */
Int_t GetCurrentEvent() const {return fCurrentEvent;}
-
+ /**
+ * Rotate a set of files. @a base is the basic name of the files.
+ * If the file @a base.max exists it is removed.
+ * If the file @a base.n exists (where n < max) it is renamed to @a
+ * base.(n-1).
+ * If the file @a base exists, it is renamed to @a base.1
+ *
+ * @param base Base name of the files
+ * @param max Maximum number to keep (minus one for the current).
+ */
+ void Rotate(const char* base, int max) const;
static const UInt_t fgkBaseDDL = 3072; // base FMD ddl
//Char_t* fDiagnosticsFilename;
TString fDiagnosticsFilename; // name of diagnostics file
std::ofstream fConditionsFile; // conditions file
Bool_t fSaveHistograms; // save hists or not
TObjArray fDetectorArray; // array indiced by detector
-
+ /**
+ * Ge the half-ring index
+ *
+ * @param UShort_t
+ * @param Char_t
+ * @param UShort_t
+ *
+ * @return
+ */
Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t) const;
+ /**
+ * Get the pulse size
+ *
+ * @param det Detector number
+ * @param ring Rin identifier
+ * @param board Board number
+ *
+ * @return Pulse step size
+ */
Int_t GetPulseSize(UShort_t det ,
Char_t ring,
- UShort_t board) {return fPulseSize.At(GetHalfringIndex(det,ring,board));}
+ UShort_t board)
+ {
+ return fPulseSize.At(GetHalfringIndex(det,ring,board));
+ }
+ /**
+ * Get number of events per pulse size
+ *
+ * @param det Detector number
+ * @param ring Rin identifier
+ * @param board Board number
+ *
+ * @return number of events per Pulse size
+ */
Int_t GetPulseLength(UShort_t det,
Char_t ring,
- UShort_t board) {return fPulseLength.At(GetHalfringIndex(det,ring,board));}
+ UShort_t board)
+ {
+ return fPulseLength.At(GetHalfringIndex(det,ring,board));
+ }
-
+ /**
+ * Get the detector path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param full If true, return full path
+ *
+ * @return Path to detector
+ */
const char* GetDetectorPath(UShort_t det, Bool_t full=kTRUE) const;
+ /**
+ * Get the ring path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param full If true, return full path
+ *
+ * @return Path to ring
+ */
const char* GetRingPath(UShort_t det, Char_t ring, Bool_t full=kTRUE) const;
+ /**
+ * Get the sector path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param full If true, return full path
+ *
+ * @return Path to sector
+ */
const char* GetSectorPath(UShort_t det, Char_t ring, UShort_t sec,
Bool_t full=kTRUE) const;
+ /**
+ * Get the strip path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param str Strip number
+ * @param full If true, return full path
+ *
+ * @return Path to strip
+ */
const char* GetStripPath(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str, Bool_t full=kTRUE) const;
Bool_t fSeenDetectors[3]; // Detectors seen so far
private:
-
+ /**
+ * Write conditions file
+ *
+ * @param fmdReader Raw input
+ */
void WriteConditionsData(AliFMDRawReader* fmdReader);
+ /**
+ * Set the current event
+ *
+ * @param currentEvent
+ */
void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
+ /**
+ * Initialize container
+ *
+ * @param dir Directory to make containers in
+ */
void InitContainer(TDirectory* dir);
Int_t fRequiredEvents; // number of events required for this calib
Int_t fCurrentEvent; // the current event
+protected:
+ UInt_t fRunno; // Current run number
-
- ClassDef(AliFMDBaseDA,0)
+ ClassDef(AliFMDBaseDA,0) // Base Detector algorithm for all run types
};
#endif
// pulse and the response of the detector.
//
#include "AliFMDGainDA.h"
-#include "iostream"
-#include "fstream"
+// #include <iostream>
+// #include <fstream>
#include "AliLog.h"
#include "TF1.h"
-#include "TH1.h"
-#include "TMath.h"
+#include "TH1S.h"
+// #include "TMath.h"
#include "TGraphErrors.h"
#include "AliFMDParameters.h"
#include "AliFMDAltroMapping.h"
+#include <TDatime.h>
//_____________________________________________________________________
ClassImp(AliFMDGainDA)
fSummaryGains("GainsSummary","Summary of gains",51200,0,51200),
fCurrentSummaryStrip(1)
{
+ // Constructor
+ //
+ // Parameters:
+ // None
fCurrentPulse.Reset(0);
fCurrentChannel.Reset(0);
fOutputFile.open("gains.csv");
fSummaryGains(gainDA.fSummaryGains),
fCurrentSummaryStrip(gainDA.fCurrentSummaryStrip)
{
+ // Copy Constructor
+ //
+ // Parameters:
+ // gainDA Object to copy from
fCurrentPulse.Reset(0);
fCurrentChannel.Reset(0);
}
//_____________________________________________________________________
AliFMDGainDA::~AliFMDGainDA()
{
+ // Destructor
+ //
+ // Parameters:
+ // None
}
//_____________________________________________________________________
void AliFMDGainDA::Init()
{
-
-
+ // Initialize
+ //
+ // Parameters:
+ // None
Int_t nEventsRequired = 0;
- //for(UShort_t det=1; det<=3;det++) {
- // UShort_t firstring = (det == 1 ? 1 : 0);
- // for(UShort_t iring = firstring; iring <=1;iring++) {
- // Char_t ring = (iring == 1 ? 'I' : 'O');
- // for(UShort_t board =0 ; board <=1; board++) {
- // Int_t idx = GetHalfringIndex(det,ring,board);
- for(Int_t idx = 0;idx<fEventsPerChannel.GetSize();idx++)
- {
-
- Int_t nEvents = 0;
- if(fPulseSize.At(idx))
- nEvents = (fPulseLength.At(idx)*fHighPulse) / fPulseSize.At(idx);
- fEventsPerChannel.AddAt(nEvents,idx);
- if(nEvents>nEventsRequired) nEventsRequired = nEvents * fNumberOfStripsPerChip;
-
- }
- //}
- // }
-
- //8 pulser values * 128 strips * 100 samples
-
+ for(Int_t idx = 0;idx<fEventsPerChannel.GetSize();idx++) {
+ Int_t nEvents = 0;
+ if(fPulseSize.At(idx))
+ nEvents = (fPulseLength.At(idx)*fHighPulse) / fPulseSize.At(idx);
+ fEventsPerChannel.AddAt(nEvents,idx);
+ if(nEvents>nEventsRequired)
+ nEventsRequired = nEvents * fNumberOfStripsPerChip;
+
+ }
SetRequiredEvents(nEventsRequired);
UShort_t sec,
UShort_t strip)
{
+ // Make a channel container
+ //
+ // Parameters:
+ // sectorArray Sectors
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // strip Strip number
TGraphErrors* hChannel = new TGraphErrors();
hChannel->SetName(Form("FMD%d%c[%02d,%03d]", det, ring, sec, strip));
hChannel->SetTitle(Form("FMD%d%c[%02d,%03d] ADC vs DAC",
}
//_____________________________________________________________________
-void AliFMDGainDA::FillChannels(AliFMDDigit* digit) {
+void AliFMDGainDA::FillChannels(AliFMDDigit* digit)
+{
+ // Fill data into histogram
+ //
+ // Parameters:
+ // digit Digit to get the data from
UShort_t det = digit->Detector();
Char_t ring = digit->Ring();
void AliFMDGainDA::Analyse(UShort_t det,
Char_t ring,
UShort_t sec,
- UShort_t strip) {
+ UShort_t strip)
+{
+ // Analyse result of a single strip
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // strip Strip number
TGraphErrors* grChannel = GetChannel(det,ring,sec,strip);
if(!grChannel->GetN()) {
AliWarning(Form("No entries for FMD%d%c, sector %d, strip %d",
//_____________________________________________________________________
void AliFMDGainDA::Terminate(TFile* diagFile)
{
+ // End of file
+ //
+ // Parameters:
+ // None
if(diagFile) {
diagFile->cd();
fSummaryGains.Write();
//_____________________________________________________________________
void AliFMDGainDA::WriteHeaderToFile()
{
+ // Write header to the output file
+ //
+ // Parameters:
+ // None
AliFMDParameters* pars = AliFMDParameters::Instance();
fOutputFile.write(Form("# %s \n",pars->GetGainShuttleID()),9);
+ TDatime now;
+ fOutputFile << "# This file created from run # " << fRunno
+ << " @ " << now.AsString() << std::endl;
fOutputFile.write("# Detector, "
"Ring, "
"Sector, "
UShort_t sec,
UShort_t strip)
{
+ // Get the current histogram of a single strip
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // strip Strip number
- UShort_t Ring = 1;
+ UShort_t lRing = 1;
if(ring == 'O')
- Ring = 0;
+ lRing = 0;
TObjArray* detArray = static_cast<TObjArray*>(fGainArray.At(det));
- TObjArray* ringArray = static_cast<TObjArray*>(detArray->At(Ring));
+ TObjArray* ringArray = static_cast<TObjArray*>(detArray->At(lRing));
TObjArray* secArray = static_cast<TObjArray*>(ringArray->At(sec));
TH1S* hChannel = static_cast<TH1S*>(secArray->At(strip));
UShort_t sec,
UShort_t strip)
{
+ // Get the graph of a single strip
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // strip Strip number
UShort_t iring = (ring == 'O' ? 0 : 1);
TObjArray* detArray = static_cast<TObjArray*>(fDetectorArray.At(det));
TObjArray* ringArray = static_cast<TObjArray*>(detArray->At(iring));
UShort_t sec,
UShort_t strip)
{
+ // Go to next pulse size
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifier
+ // sec Sector number
+ // strip Strip number
AliFMDParameters* pars = AliFMDParameters::Instance();
// UInt_t ddl, board,chip,ch;
//_____________________________________________________________________
void AliFMDGainDA::ResetPulseAndUpdateChannel()
{
+ // Reset all
+ //
+ // Parameters:
+ // None
fCurrentPulse.Reset(0);
}
//_____________________________________________________________________
void AliFMDGainDA::FinishEvent()
{
+ // End of event
+ //
+ // Parameters:
+ // None
for(UShort_t det=1; det<=3;det++) {
UShort_t firstring = (det == 1 ? 1 : 0);
for(UShort_t iring = firstring; iring <=1;iring++) {
for(UShort_t board =0 ; board <=1; board++) {
Int_t idx = GetHalfringIndex(det,ring,board);
- if( !fPulseLength.At(idx) || !fEventsPerChannel.At(idx))
+ if(!fPulseLength.At(idx) || !fEventsPerChannel.At(idx))
continue;
- if(GetCurrentEvent()>0 && ((GetCurrentEvent() % fPulseLength.At(idx)) == 0))
+ if(GetCurrentEvent()>0 &&
+ ((GetCurrentEvent() % fPulseLength.At(idx)) == 0))
fCurrentPulse.AddAt(fCurrentPulse.At(idx)+1,idx);
- if(GetCurrentEvent()>0 && ((GetCurrentEvent()) % fEventsPerChannel.At(idx)) == 0)
+ if(GetCurrentEvent()>0 &&
+ ((GetCurrentEvent()) % fEventsPerChannel.At(idx)) == 0)
fCurrentPulse.AddAt(0,idx);
}
}
#include "AliFMDBaseDA.h"
-#include "TH1.h"
+#include "TH1F.h"
#include "TObjArray.h"
-#include "TGraphErrors.h"
+// #include "TGraphErrors.h"
+class TGraphErrors;
+class TH1S;
-class AliFMDGainDA: public AliFMDBaseDA {
-
- public:
-
+class AliFMDGainDA: public AliFMDBaseDA
+{
+public:
+ /**
+ * Constructor
+ *
+ */
AliFMDGainDA() ;
+ /**
+ * Copy constructor
+ *
+ * @param gainDA Object to copy from
+ */
AliFMDGainDA(const AliFMDGainDA & gainDA) ;
- // AliFMDGainDA& operator = (const AliFMDGainDA & gainDA) ;
+ /**
+ * Destructor
+ *
+ */
virtual ~AliFMDGainDA();
+ /**
+ * Initialize
+ *
+ */
void Init();
- // void SetPulseSize(Int_t pulseSize = 32) {fPulseSize = pulseSize; }
+ /**
+ * Set the maximum pulse size
+ *
+ * @param highPulse Maximum pulse size
+ */
void SetMaxPulse(Int_t highPulse = 256) {fHighPulse = highPulse; }
- // void SetPulseLength(Int_t pulseLength = 100) {fPulseLength = pulseLength; }
+ /**
+ * Set the number of strips per input channel
+ *
+ * @param nStrips Number of strips per channel
+ */
void SetNumberOfStrips(Int_t nStrips) {fNumberOfStripsPerChip = nStrips;}
- protected:
-
- void AddChannelContainer(TObjArray* sectorArray, UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
+protected:
+ /**
+ * Make a container for a channel
+ *
+ * @param sectorArray Sectors
+ * @param det Detector #
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param strip Strip number
+ */
+ void AddChannelContainer(TObjArray* sectorArray,
+ UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t strip);
+ /**
+ * Fill channel histogram
+ *
+ * @param digit Digit to fill from
+ */
void FillChannels(AliFMDDigit* digit);
+ /**
+ * Analyse the result
+ *
+ * @param det Detector #
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param strip Strip number
+ */
void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
+ /**
+ * Write out the header
+ */
void WriteHeaderToFile();
- void UpdatePulseAndADC(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
+ /**
+ * Go to the next sample
+ *
+ * @param det Detector #
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param strip Strip number
+ */
+ void UpdatePulseAndADC(UShort_t det,
+ Char_t ring,
+ UShort_t sec,
+ UShort_t strip);
+ /**
+ * Reset all
+ *
+ */
void ResetPulseAndUpdateChannel();
+ /**
+ * End of event
+ *
+ */
void FinishEvent();
- void Terminate(TFile* );
-
- private:
+ /**
+ * End of job
+ *
+ * @param dummy Not used
+ */
+ void Terminate(TFile* dummy);
- TH1S* GetChannelHistogram(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
- TGraphErrors* GetChannel(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
- TObjArray fGainArray;
- // Int_t fPulseSize;
- Int_t fHighPulse;
- //Int_t fPulseLength;
- TArrayS fEventsPerChannel;
- TArrayS fCurrentPulse;
- TArrayS fCurrentChannel;
- Int_t fNumberOfStripsPerChip;
+private:
+ /**
+ * Get the channel histogram
+ *
+ * @param det Detector #
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param strip Strip number
+ *
+ * @return Histogram
+ */
+ TH1S* GetChannelHistogram(UShort_t det, Char_t ring, UShort_t sec,
+ UShort_t strip);
+ /**
+ * Get strip graph
+ *
+ * @param det Detector #
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param strip Strip number
+ *
+ * @return Graph
+ */
+ TGraphErrors* GetChannel(UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t strip);
+ TObjArray fGainArray; // Array of gains
+ Int_t fHighPulse; // Highest pulse
+ TArrayS fEventsPerChannel; // # of events per pulse step
+ TArrayS fCurrentPulse; // The current pulse size
+ TArrayS fCurrentChannel; // The current strip number
+ Int_t fNumberOfStripsPerChip; // Number of strips
- TH1F fSummaryGains;
- Int_t fCurrentSummaryStrip;
+ TH1F fSummaryGains; // Summary histogram
+ Int_t fCurrentSummaryStrip; // Current strip for summary
- ClassDef(AliFMDGainDA,0)
+ ClassDef(AliFMDGainDA,0) // Detector algorithm for gain runs
};
#endif
+// Local Variables:
+// mode: C++
+// End:
#include "TObject.h"
#include "TMath.h"
#include <TSystem.h>
+#include <TDatime.h>
//_____________________________________________________________________
ClassImp(AliFMDPedestalDA)
fMaxTimebin(3 * 4 * 3 * 16) // 3 ddls, 4 FECs, 3 Altros, 16 channels
{
// Default constructor
+ Rotate("peds.csv", 3);
fOutputFile.open("peds.csv");
+ Rotate("ddl3072.csv", 10);
fZSfileFMD1.open("ddl3072.csv");
+ Rotate("ddl3073.csv", 10);
fZSfileFMD2.open("ddl3073.csv");
+ Rotate("ddl3074.csv", 10);
fZSfileFMD3.open("ddl3074.csv");
}
// Write headers to output files
AliFMDParameters* pars = AliFMDParameters::Instance();
fOutputFile.write(Form("# %s \n",pars->GetPedestalShuttleID()),13);
+ TDatime now;
+ fOutputFile << "# This file created from run # " << fRunno
+ << " @ " << now.AsString() << std::endl;
fOutputFile.write("# Detector, "
"Ring, "
"Sector, "
"Chi2/NDF \n", 71);
std::ostream* zss[] = { &fZSfileFMD1, &fZSfileFMD2, &fZSfileFMD3, 0 };
- for (size_t i = 0; i < 3; i++)
- *(zss[i]) << "# FMD 1 pedestals \n"
+ for (size_t i = 0; i < 3; i++) {
+ *(zss[i]) << "# FMD " << (i+1) << " pedestals \n"
<< "# board, "
<< "altro, "
<< "channel, "
<< "timebin, "
<< "pedestal, "
<< "noise\n";
+ *(zss[i]) << "# This file created from run # " << fRunno
+ << " @ " << now.AsString() << std::endl;
+ }
}
//_____________________________________________________________________
reader = new AliRawReaderDate((void*)event);
baseDA.Run(reader);
SODread = kTRUE;
- retval = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
+ retval =
+ daqDA_FES_storeFile("conditions.csv",
+ AliFMDParameters::Instance()->GetConditionsShuttleID());
if (retval != 0) std::cerr << "Base DA failed" << std::endl;
break;
timer.Stop();
timer.Print();
- Int_t retvalConditions = daqDA_FES_storeFile("conditions.csv", AliFMDParameters::Instance()->GetConditionsShuttleID());
- Int_t retvalPeds = daqDA_FES_storeFile("peds.csv", AliFMDParameters::Instance()->GetPedestalShuttleID());
+ Int_t retvalConditions =
+ daqDA_FES_storeFile("conditions.csv",
+ AliFMDParameters::Instance()->GetConditionsShuttleID());
+ Int_t retvalPeds =
+ daqDA_FES_storeFile("peds.csv",
+ AliFMDParameters::Instance()->GetPedestalShuttleID());
if(retvalConditions!=0 || retvalPeds!=0)
std::cerr << "Pedestal DA failed" << std::endl;