60 #include <TObjString.h> 61 #include <TTimeStamp.h> 65 #include "AliAltroRawStream.h" 79 fNFailL1PhaseEvent(0),
82 fPadProcessed(kFALSE),
94 fArrCurrentPhaseDist(4),
95 fArrCurrentPhase(
kNRCU),
96 fArrFailEventNumber(100),
97 fArrALTROL1Phase(100000),
98 fArrALTROL1PhaseEvent(kNRCU),
99 fArrALTROL1PhaseFailEvent(kNRCU),
101 fVOccupancyEvent(100000),
102 fVSignalSumEvent(100000),
103 fVOccupancySenEvent(100000),
104 fVSignalSumSenEvent(100000),
105 fVNfiredPadsSenEvent(100000),
106 fVTimeStampEvent(100000)
111 SetNameTitle(
"AliTPCCalibRaw",
"AliTPCCalibRaw");
113 for (Int_t ircu=0;ircu<
kNRCU;++ircu) fArrCurrentPhase.GetMatrixArray()[ircu]=-1;
123 fNFailL1PhaseEvent(0),
126 fPadProcessed(kFALSE),
138 fArrCurrentPhaseDist(4),
139 fArrCurrentPhase(
kNRCU),
140 fArrFailEventNumber(100),
141 fArrALTROL1Phase(100000),
142 fArrALTROL1PhaseEvent(
kNRCU),
143 fArrALTROL1PhaseFailEvent(
kNRCU),
145 fVOccupancyEvent(100000),
146 fVSignalSumEvent(100000),
147 fVOccupancySenEvent(100000),
148 fVSignalSumSenEvent(100000),
149 fVNfiredPadsSenEvent(100000),
150 fVTimeStampEvent(100000)
154 SetNameTitle(
"AliTPCCalibRaw",
"AliTPCCalibRaw");
159 if (config->GetValue(
"FirstTimeBin"))
fFirstTimeBin = ((TObjString*)config->GetValue(
"FirstTimeBin"))->GetString().Atoi();
160 if (config->GetValue(
"LastTimeBin"))
fLastTimeBin = ((TObjString*)config->GetValue(
"LastTimeBin"))->GetString().Atoi();
161 if (config->GetValue(
"DebugLevel"))
fDebugLevel = ((TObjString*)config->GetValue(
"DebugLevel"))->GetString().Atoi();
185 const Int_t iTimeBin,
const Float_t signal)
189 if (iRow<0)
return 0;
190 if (iPad<0)
return 0;
191 if (iTimeBin<0)
return 0;
199 Int_t cpad=iPad-npads/2;
202 if ( iRow>19 && iRow<46 ){
203 if ( TMath::Abs(cpad)<7 ){
209 }
else if ( iRow>75 ){
211 Int_t padEdge=(Int_t)TMath::Min(iPad,npads-iPad);
213 if ((nrows-iRow-1)<3 || padEdge<((((Int_t)iRow-76)/4+1))*2){
222 if (
IsEdgePad(isector,iRow,iPad))
return 0;
292 Int_t phaseMaxEntries=-1;
296 if (maxEntries<entries) {
308 for (Int_t ircu=0;ircu<
kNRCU;++ircu){
310 if (phase<0)
continue;
311 if (phase!=phaseMaxEntries){
351 Bool_t newVersion=kFALSE;
352 for (Int_t ircu=0; ircu<
kNRCU; ++ircu){
361 TH2C *h2 =
new TH2C(
"hL1FailRCUEvents",
"L1 Failures;RCU;Event",kNRCU,0,kNRCU,nevents,0,nevents);
363 for (Int_t ircu=0;ircu<
kNRCU;++ircu) {
369 }
else if (type==1) {
375 for (Int_t iev=0;iev<nevents;++iev) {
376 Float_t val=(*v)(iev);
382 if (type==0) val=(val!=phase);
383 h2->SetBinContent(ircu+1,iev+1,val+add);
393 TH1F *h=
new TH1F(
"L1phaseDist",
"Normalized L1 phase distribution;phase;fraction of events",4,0,4);
396 if (
GetNevents()>0) h->Scale(1./GetNevents());
406 TVectorF *v=
new TVectorF(4);
409 ((v->GetMatrixArray())[phase])+=1./
GetNevents();
419 TH2C *h2 =
new TH2C(
"hL1FailRCUEventsIROC",
"L1 Failures IROCs;RCU;Event",72,0,36,
GetNevents(),0,
GetNevents());
420 for (Int_t ircu=0;ircu<72;++ircu) {
426 h2->SetBinContent(ircu+1,iev+1,(*v)(iev));
437 TH2C *h2 =
new TH2C(
"hL1FailRCUEventsOROC",
"L1 Failures OROCs;RCU;Event",144,0,36,
GetNevents(),0,
GetNevents());
438 for (Int_t ircu=72;ircu<
kNRCU;++ircu) {
444 h2->SetBinContent(ircu-72+1,iev+1,(*v)(iev));
460 fHnDrift=
new THnSparseI(
"fHnDrift",Form(
"Drift velocity using last time bin;time bin[#times 100ns];ROC;Time bin [#times %us]",
fNSecTime),
kHnBinsDV, bins, xmin, xmax);
470 for (Int_t ircu=0;ircu<
kNRCU;++ircu){
521 TString title(
"Event occupancy");
522 TString xTitle(
"Time");
523 TString yTitle(
"number of samples");
529 Double_t norm=557568.;
531 AliWarning(
"In non debug mode only occupancy in sensitive regions vs. event awailable!!!");
541 Double_t nAboveThreshold=vOcc->GetMatrixArray()[i];
544 Double_t timestamp =1;
548 nSumADC =vSum->GetMatrixArray()[i];
550 nPads =vPads->GetMatrixArray()[i];
552 Double_t x=timestamp;
557 if (type%10==0) y=nAboveThreshold;
558 if (type%10==1&&nAboveThreshold>0) y=nSumADC/nAboveThreshold;
559 if (type%10==2) y=nSumADC;
560 if (type%10==3&&nSumADC>0) y=nAboveThreshold/nSumADC;
563 if (type==16&&nPads>0) y=nAboveThreshold/nPads;
564 if (type==17) y=nPads/norm;
568 if (xType==1) xTitle=
"Event";
569 if (type%10==1) yTitle=
"Mean ADC counts/sample";
570 else if (type%10==2) yTitle=
"Data volume [ADC counts]";
571 else if (type%10==3) yTitle=
"samples per ADC count";
572 else if (type%10==4) yTitle=
"sample occupancy";
573 if (type==5) yTitle=
"N samples (sensitive) / N samples";
574 if (type%10==6) yTitle=
"N samples / N pads";
575 if (type==17) yTitle=
"Pad Occupancy";
576 if (type>=10) yTitle+=
" (sensitive)";
577 title=yTitle+
":"+xTitle;
578 title+=
";"+xTitle+
";"+yTitle;
579 gr->SetTitle(title.Data());
580 gr->SetEditable(kFALSE);
600 TString name(
"RawOccupancy_");
601 TString title(
"Raw Occupancy vs. ");
605 }
else if (xType==1){
611 title+=
" (sensitive)";
613 TCanvas *c=(TCanvas*)
gROOT->GetListOfCanvases()->FindObject(name.Data());
614 if (!c) c=
new TCanvas(name.Data(),title.Data());
617 for (Int_t i=0;i<4;++i){
650 while ( (o=next()) ){
TH2C * MakeHistL1RCUEvents(Int_t type=0)
UInt_t fNFailL1Phase
Number of failures in L1 phase.
Double_t GetL1PhaseTB() const
TVectorF fArrCurrentPhaseDist
! Phase distribution of the current event
Int_t fPeakTimeBin
! time bin with local maximum
UInt_t GetNPads(UInt_t sector, UInt_t row) const
Int_t fCurrentPad
! current pad processed
Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad) const
UInt_t fFirstTimeStamp
First event time stamp.
Int_t fPeakDetPlus
Consecutive timebins on falling edge to be regarded as a signal.
const TVectorF * GetALTROL1PhaseFailEventsRCU(Int_t rcu) const
virtual void ResetEvent()
UInt_t GetNRows(UInt_t sector) const
void MergeBase(const AliTPCCalibRawBase *calib)
void Merge(AliTPCCalibRaw *const sig)
TVectorF fArrCurrentPhase
! Current phase of all RCUs
TGraph * MakeGraphOccupancy(const Int_t type=0, const Int_t xType=0)
Int_t fLastTimeBinProc
! last time bin processed
TVectorF fVSignalSumEvent
occupancy per event (sum of all adc values)
Int_t fCurrentRow
! current row processed
Int_t fLastTimeBin
Last Time bin used for analysis.
Base class for the calibration algorithms using raw data as input.
#define AliWarning(message)
Int_t fLastSignal
! last signal processed
Int_t fNanoSec
! current nano seconds stamp
TH2C * MakeHistL1RCUEventsIROC(Int_t type=0)
const TVectorF * GetALTROL1PhaseEventsRCU(Int_t rcu) const
UInt_t fNSecTime
Number of seconds per bin in time.
UInt_t GetNInnerSector() const
AliTPCROC * fROC
! ROC information
Int_t fFirstTimeBin
First Time bin used for analysis.
UInt_t GetTimeStamp() const
const UInt_t * GetRowIndexes(UInt_t sector) const
TH1F * MakeHistL1PhaseDist()
UInt_t fNBinsTime
Number of bin in time.
UInt_t fNFailL1PhaseEvent
Number of events with L1 phase failures.
Int_t fCurrDDLNum
! Current DDL number
UInt_t fTimeStamp
! time stamp from event header
Int_t fNOkPlus
! number of processed time bins fullfilling peak criteria
TVectorF * MakeArrL1PhaseRCU(Int_t rcu, Bool_t force=kFALSE)
TVectorF fVSignalSumSenEvent
occupancy per event (sum of all adc values) in sensitive regions
Int_t fCurrentChannel
! current channel processed
TVectorF * MakeVectL1PhaseDist()
THnSparseI * fHnDrift
Histogram last time bin vs. ROC, Time.
virtual ~AliTPCCalibRaw()
TVectorF fVTimeStampEvent
timestamp for all events
TH2C * MakeHistL1RCUEventsOROC(Int_t type=0)
Bool_t fPadProcessed
! if last pead has already been filled for the current pad
TVectorF fArrFailEventNumber
event numbers of failed events;
Int_t fPeakDetMinus
Consecutive timebins on rising edge to be regarded as a signal.
TVectorF fVNfiredPadsSenEvent
number of pads with a signal above threshold in sensitive regions
Int_t fNOkMinus
! number of processed time bins fullfilling peak criteria
virtual Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad, const Int_t iTimeBin, const Float_t signal)
TVectorF fVOccupancyEvent
occupancy per event (number of samples above threshold)
TCanvas * MakeCanvasOccupancy(const Int_t xType=1, Bool_t sen=kFALSE)
Int_t fDebugLevel
! debug level
TVectorF fArrALTROL1Phase
Array of L1 phases on an event bases;.
Implementation of the TPC Raw drift velocity and Altro L1 Phase calibration.
TVectorF fVOccupancySenEvent
occupancy per event (number of samples abouve threshold) in sensitive regions