#include "TMath.h"
#include "TGraphErrors.h"
#include "AliFMDParameters.h"
+#include "AliFMDAltroMapping.h"
//_____________________________________________________________________
ClassImp(AliFMDGainDA)
UShort_t sec = digit->Sector();
UShort_t strip = digit->Strip();
- //Strip is always seen as the first in a VA chip. All other strips are junk
- if(strip % fNumberOfStripsPerChip) return;
+ //Strip is always seen as the first in a VA chip. All other strips are junk.
+ //Strips are counted from zero on even sectors and from 511 on odd sectors...
+
+ if((sec%2) && ((strip+1) % fNumberOfStripsPerChip)) return;
+ if(((sec+1)%2) && (strip % fNumberOfStripsPerChip)) return;
+
Int_t vaChip = strip / fNumberOfStripsPerChip;
TH1S* hChannel = GetChannelHistogram(det, ring, sec, vaChip);
-
hChannel->Fill(digit->Counts());
UpdatePulseAndADC(det,ring,sec,strip);
}
UShort_t strip) {
TGraphErrors* grChannel = GetChannel(det,ring,sec,strip);
if(!grChannel->GetN()) {
- // AliWarning(Form("No entries for FMD%d%c, sector %d, strip %d",
- // det, ring , sec, strip));
+ AliWarning(Form("No entries for FMD%d%c, sector %d, strip %d",
+ det, ring , sec, strip));
return;
}
TF1 fitFunc("fitFunc","pol1",-10,280);
<< chi2ndf <<"\n";
//due to RCU trouble, first strips on VAs are excluded
- if(strip%128 != 0) {
+ // if(strip%128 != 0) {
- fSummaryGains.SetBinContent(fCurrentSummaryStrip,fitFunc.GetParameter(1));
- fSummaryGains.SetBinError(fCurrentSummaryStrip,fitFunc.GetParError(1));
-
- fCurrentSummaryStrip++;
- }
+ fSummaryGains.SetBinContent(fCurrentSummaryStrip,fitFunc.GetParameter(1));
+ fSummaryGains.SetBinError(fCurrentSummaryStrip,fitFunc.GetParError(1));
+
+ fCurrentSummaryStrip++;
+ // }
if(fSaveHistograms) {
gDirectory->cd(GetSectorPath(det,ring, sec, kTRUE));
//_____________________________________________________________________
void AliFMDGainDA::Terminate(TFile* diagFile)
{
- diagFile->cd();
- fSummaryGains.Write();
+ if(diagFile) {
+ diagFile->cd();
+ fSummaryGains.Write();
+ }
}
//_____________________________________________________________________
{
AliFMDParameters* pars = AliFMDParameters::Instance();
- UInt_t ddl, board,chip,ch;
- pars->Detector2Hardware(det,ring,sec,strip,ddl,board,chip,ch);
+ // UInt_t ddl, board,chip,ch;
+ UShort_t board = pars->GetAltroMap()->Sector2Board(ring, sec);
+ // pars->Detector2Hardware(det,ring,sec,strip,ddl,board,chip,ch);
+ /// pars->GetAltroMap()->Strip2Channel(
Int_t halfring = GetHalfringIndex(det,ring,board/16);
if(GetCurrentEvent()> (fNumberOfStripsPerChip*fEventsPerChannel.At(halfring)))
return;
- if(strip % fNumberOfStripsPerChip) return;
- if(((GetCurrentEvent()) % fPulseLength.At(halfring)) && GetCurrentEvent() > 0) return;
+
+ if((sec%2) && ((strip+1) % fNumberOfStripsPerChip)) return;
+
+ if(((sec+1)%2) && (strip % fNumberOfStripsPerChip)) return;
+
+ if(((GetCurrentEvent()) % fPulseLength.At(halfring))
+ && GetCurrentEvent() > 0) return;
Int_t vaChip = strip/fNumberOfStripsPerChip;
TH1S* hChannel = GetChannelHistogram(det,ring,sec,vaChip);
}
Double_t mean = hChannel->GetMean();
Double_t rms = hChannel->GetRMS();
- Double_t pulse = Double_t(fCurrentPulse.At(halfring)) * fPulseSize.At(halfring);
+ Double_t pulse = (Double_t(fCurrentPulse.At(halfring))
+ * fPulseSize.At(halfring));
Int_t firstBin = hChannel->GetXaxis()->GetFirst();
Int_t lastBin = hChannel->GetXaxis()->GetLast();
hChannel->GetXaxis()->SetRangeUser(mean-4*rms,mean+4*rms);
hChannel->GetXaxis()->SetRange(firstBin,lastBin);
- Int_t channelNumber = strip + (GetCurrentEvent()-1)/((fPulseLength.At(halfring)*fHighPulse)/fPulseSize.At(halfring));
+ Int_t channelNumber = (strip +
+ (GetCurrentEvent()-1)
+ / ((fPulseLength.At(halfring)*fHighPulse)
+ / fPulseSize.At(halfring)));
+ if(sec%2)
+ channelNumber = (strip -
+ (GetCurrentEvent()-1)
+ / ((fPulseLength.At(halfring)*fHighPulse)
+ / fPulseSize.At(halfring)));
TGraphErrors* channel = GetChannel(det,ring,sec,channelNumber);