fName(0),
fLevel(0),
fDelay(0),
- fEdge(0)
+ fEdge(0),
+ fDeltaMin(0),
+ fDeltaMax(0)
{
// Default constructor
}
//_____________________________________________________________________________
-AliCTPInputTimeParams::AliCTPInputTimeParams( TString& name, UInt_t& level, UInt_t delay, TString edge ):
+AliCTPInputTimeParams::AliCTPInputTimeParams( TString& name, UInt_t& level, UInt_t delay, TString edge, UInt_t deltamin, UInt_t deltamax ):
fName(name),
fLevel(level),
fDelay( delay),
- fEdge(edge)
+ fEdge(edge),
+ fDeltaMin(deltamin),
+ fDeltaMax(deltamax)
{
}
//_____________________________________________________________________________
fName(ctptime.fName),
fLevel(ctptime.fLevel),
fDelay(ctptime.fDelay),
- fEdge(ctptime.fEdge)
+ fEdge(ctptime.fEdge),
+ fDeltaMin(ctptime.fDeltaMin),
+ fDeltaMax(ctptime.fDeltaMax)
+
{
// copy constructor
}
fLevel=ctptime.fLevel;
fDelay=ctptime.fDelay;
fEdge=ctptime.fEdge;
+ fDeltaMin=ctptime.fDeltaMin;
+ fDeltaMax=ctptime.fDeltaMax;
return *this;
}
//_____________________________________________________________________________
-void AliCTPInputTimeParams::SetCTPInputTimeParams( TString name, UInt_t level, UInt_t delay, TString edge )
+void AliCTPInputTimeParams::SetCTPInputTimeParams( TString name, UInt_t level, UInt_t delay, TString edge, UInt_t deltamin, UInt_t deltamax )
{
fName = name;
fLevel = level;
fDelay = delay;
fEdge = edge;
+ fDeltaMin = deltamin;
+ fDeltaMax = deltamax;
}
//_____________________________________________________________________________
cout << " Level: " << fLevel << endl;
cout << " Delay: " << fDelay << endl;
cout << " Edge: " << fEdge << endl;
+ cout << " DeltaMin: " << fDeltaMin << endl;
+ cout << " DeltaMax: " << fDeltaMax << endl;
}
public:
AliCTPInputTimeParams();
- AliCTPInputTimeParams( TString& name, UInt_t& level, UInt_t delay, TString edge );
+ AliCTPInputTimeParams( TString& name, UInt_t& level, UInt_t delay, TString edge, UInt_t deltamin, UInt_t deltamax );
virtual ~AliCTPInputTimeParams() {}
AliCTPInputTimeParams( const AliCTPInputTimeParams &ctptime );
UInt_t GetLevel() const { return fLevel; }
UInt_t GetDelay() const { return fDelay; }
TString GetEdge() const { return fEdge; }
-
+ UInt_t GetDeltaMin() const { return fDeltaMin; }
+ UInt_t GetDeltaMax() const { return fDeltaMax; }
// Setters
void SetCTPInputTimeParams( TString name, UInt_t level,
- UInt_t delay, TString edge );
+ UInt_t delay, TString edge, UInt_t deltamin, UInt_t deltamax );
virtual void Print( const Option_t* opt ="" ) const;
UInt_t fLevel;
UInt_t fDelay;
TString fEdge;
+ UInt_t fDeltaMin;
+ UInt_t fDeltaMax;
private:
- ClassDef( AliCTPInputTimeParams, 1 )
+ ClassDef( AliCTPInputTimeParams, 2 )
};
}
//______________________________________________________________________________
-void AliCTPTimeParams::AddInput( TString& inputName, UInt_t& inputLevel, UInt_t inputDelay, TString inputEdge )
+void AliCTPTimeParams::AddInput( TString& inputName, UInt_t& inputLevel, UInt_t inputDelay, TString inputEdge, UInt_t deltamin, UInt_t deltamax )
{
- fCTPInputTimeParams.AddLast( new AliCTPInputTimeParams(inputName, inputLevel, inputDelay, inputEdge ));
+ fCTPInputTimeParams.AddLast( new AliCTPInputTimeParams(inputName, inputLevel, inputDelay, inputEdge, deltamin, deltamax ));
}
//______________________________________________________________________________
fDelayL2L0 = delayL2L0;
}
//______________________________________________________________________________
+AliCTPInputTimeParams* AliCTPTimeParams::GetTimeParamsForInput( TString inputname)
+{
+Int_t ninputs = fCTPInputTimeParams.GetEntriesFast();
+for ( Int_t i=0; i < ninputs; i++ )
+ {
+ AliCTPInputTimeParams* ctpinputtime = (AliCTPInputTimeParams*)fCTPInputTimeParams.At(i);
+ if (inputname == ctpinputtime->GetInputName() ) return ctpinputtime;
+ }
+return NULL;
+}
+//______________________________________________________________________________
AliCTPTimeParams* AliCTPTimeParams::LoadCTPTimeParams(TString filename)
{
// Load pre-created CTP time parameters from database/file
delete tokens;
}
else {
- if (strline.BeginsWith("0")) { level = 0; } // determine the input level (0, 1 or 2)
- else if (strline.BeginsWith("1")) { level = 1; }
- else if (strline.BeginsWith("2")) { level = 2; }
- else {
- return 0; // file not in the right format!
- }
+ if (strline.BeginsWith("0")) { level = 0; } // determine the input level (0, 1 or 2)
+ else if (strline.BeginsWith("1")) { level = 1; }
+ else if (strline.BeginsWith("2")) { level = 2; }
+ else return kFALSE; // file not in the right format!
- TObjArray *tokens = strline.Tokenize(" \t");
- AddInput(((TObjString*)tokens->At(0))->String(), level, ((TObjString*)tokens->At(2))->String().Atoi(), ((TObjString*)tokens->At(1))->String() );
+ TObjArray *tokens = strline.Tokenize(" \t");
+ Int_t ntokens = tokens->GetEntriesFast();
+ if (ntokens == 5) AddInput(((TObjString*)tokens->At(0))->String(), level, ((TObjString*)tokens->At(2))->String().Atoi(), ((TObjString*)tokens->At(1))->String(), ((TObjString*)tokens->At(3))->String().Atoi(), ((TObjString*)tokens->At(4))->String().Atoi());
+ else if (ntokens == 3) AddInput(((TObjString*)tokens->At(0))->String(), level, ((TObjString*)tokens->At(2))->String().Atoi(), ((TObjString*)tokens->At(1))->String(), 0, 0); //the old format is used - no DeltaMin & DeltaMax!
+ else return kFALSE; // file not in the right format!
}
-
return kTRUE;
}
#include<TNamed.h>
#include<TObjArray.h>
+#include<AliCTPInputTimeParams.h>
class TNamed;
static AliCTPTimeParams* LoadCTPTimeParams(TString filename);
static AliCTPTimeParams* LoadCTPTimeParamsFromString(const char* timeparams);
Bool_t ProcessCTPTimeParamsLine(const char* line);
- void AddInput( TString& inputName, UInt_t& inputLevel, UInt_t inputDelay, TString inputEdge );
+ void AddInput( TString& inputName, UInt_t& inputLevel, UInt_t inputDelay, TString inputEdge, UInt_t deltamin, UInt_t deltamax );
void AddDelayL0L1L2(UInt_t delayL1L0, UInt_t delayL2L0);
virtual void Print(const Option_t* opt="") const;
//Setters
//Getters
UInt_t GetDelayL1L0() const { return fDelayL1L0; }
UInt_t GetDelayL2L0() const { return fDelayL2L0; } const TObjArray* GetInputTimeParams() const { return &fCTPInputTimeParams; }
+ AliCTPInputTimeParams* GetTimeParamsForInput(TString inputname);
enum {kNMaxInputs = 60}; //CTP can manage up to 60 trigger detector inputs
private:
UInt_t fDelayL1L0;
UInt_t fDelayL2L0;
TObjArray fCTPInputTimeParams;
- ClassDef( AliCTPTimeParams, 1 )
+ ClassDef( AliCTPTimeParams, 2 )
};
#endif