AliTPCCalibTCF::AliTPCCalibTCF() :
TNamed(),
- fGateWidth(100),
+ fGateWidth(80),
fSample(900),
fPulseLength(500),
fLowPulseLim(30),
continue;
} else {
// still the same pad, save signal to temporary histogram
- if (time<=fSample+fGateWidth && time>fGateWidth) {
+ if ( (time<=fSample+fGateWidth) && (time>=fGateWidth)) {
tempHis->SetBinContent(time,signal);
}
}
Int_t maxpos = tempHis->GetMaximumBin();
Int_t first = (Int_t)TMath::Max(maxpos-10, 0);
- Int_t last = TMath::Min((Int_t)maxpos+fPulseLength-10, fSample);
+ Int_t last = TMath::Min((Int_t)maxpos+fPulseLength-10, fSample+fGateWidth);
// simple baseline substraction ? better one needed ? (pedestalsubstr.?)
// and RMS calculation with timebins before the pulse and at the end of
}
// Decision if found pulse is a proper one according to given tresholds
- if (max>lowLim && max<upLim && !((last-first)<fPulseLength) && rms<fRMSLim && (intHist/intPulse)<fRatioIntLim && binRatio >= 0.1) {
+ if (max>lowLim && max<upLim && !((last-first)<fPulseLength) && rms<fRMSLim && (intHist/intPulse)<fRatioIntLim && (binRatio >= 0.1) ) {
char hname[100];
sprintf(hname,"sec%drow%dpad%d",prevSec,prevRow,prevPad);
Int_t maxpos = tempHis->GetMaximumBin();
Int_t first = (Int_t)TMath::Max(maxpos-10, 0);
- Int_t last = TMath::Min((Int_t)maxpos+fPulseLength-10, fSample);
+ Int_t last = TMath::Min((Int_t)maxpos+fPulseLength-10, fSample+fGateWidth);
// simple baseline substraction ? better one needed ? (pedestalsubstr.?)
// Decision if found pulse is a proper one according to given tresholds
- if (max>lowLim && max<upLim && !((last-first)<fPulseLength) && rms<fRMSLim && intHist/intPulse<fRatioIntLim && binRatio >= 0.1){
+ if (max>lowLim && max<upLim && !((last-first)<fPulseLength) && rms<fRMSLim && intHist/intPulse<fRatioIntLim && (binRatio >= 0.1) ){
// note:
// assuming that lowLim is higher than the pedestal value!
char hname[100];
TIter next(fileIn.GetListOfKeys());
TH2F * his2D = new TH2F("his2D","his2D", 250,-250,250,250,-250,250);
+
AliTPCROC * roc = AliTPCROC::Instance();
Int_t nHist=fileIn.GetNkeys();
+ if (!nHist) { return 0; }
+
Int_t iHist = 0;
Float_t xyz[3];
Int_t pad = 0;
while ((key = (TKey *) next())) { // loop over histograms within the file
- iHist+=1;
+ iHist++;
his = (TH1F*)fileIn.Get(key->GetName()); // copy object to memory
npulse = (Int_t)his->GetBinContent(1);
row = (Int_t)his->GetBinContent(3);
pad = (Int_t)his->GetBinContent(4);
- if (side==0 && sec%36>=18) continue;
- if (side>0 && sec%36<18) continue;
+ if ( (side==0) && (sec%36>=18) ) continue;
+ if ( (side>0) && (sec%36<18) ) continue;
- if (row==-1 & pad==-1) { // summed pulses per sector
+ if ( (row==-1) && (pad==-1) ) { // summed pulses per sector
// fill all pad with this values
for (UInt_t rowi=0; rowi<roc->GetNRows(sec); rowi++) {
- for (UInt_t padi=0; padi<roc->GetNPads(sec,row); padi++) {
+ for (UInt_t padi=0; padi<roc->GetNPads(sec,rowi); padi++) {
roc->GetPositionGlobal(sec,rowi,padi,xyz);
binx = 1+TMath::Nint((xyz[0]+250.)*0.5);
biny = 1+TMath::Nint((xyz[1]+250.)*0.5);
}
his2D->SetXTitle("x (cm)");
his2D->SetYTitle("y (cm)");
+ his2D->SetStats(0);
+
+ his2D->DrawCopy("colz");
if (!side) {
gPad->SetTitle("A side");
gPad->SetTitle("C side");
}
- his2D->DrawCopy("colz");
return his2D;
}
char nameFileOut[100];
sprintf(nameFileOut,"Occup-%s",nameFile);
TFile fileOut(nameFileOut,"RECREATE");
- fileOut.cd();
+ // fileOut.cd();
TNtuple *ntuple = new TNtuple("ntuple","ntuple","x:y:z:npulse");
- // ntuple->SetDirectory(0); // force to be memory resistent
+ // ntuple->SetDirectory(0); // force to be memory resistent
Int_t nHist=file->GetNkeys();
+ if (!nHist) { return; }
Int_t iHist = 0;
Int_t secWise = 0;
while ((key = (TKey *) next())) { // loop over histograms within the file
- iHist+=1;
his = (TH1F*)file->Get(key->GetName()); // copy object to memory
-
+ iHist++;
Int_t npulse = (Int_t)his->GetBinContent(1);
Int_t sec = (Int_t)his->GetBinContent(2);
Int_t row = (Int_t)his->GetBinContent(3);
Int_t pad = (Int_t)his->GetBinContent(4);
- // if (side==0 && sec%36>=18) continue;
- // if (side>0 && sec%36<18) continue;
-
- if (row==-1 & pad==-1) { // summed pulses per sector
+ if ( (row==-1) && (pad==-1) ) { // summed pulses per sector
row = 40; pad = 40; // set to approx middle row for better plot
secWise=1;
}
}
pos->~Float_t();
}
-
if (secWise) { // pulse per sector
ntuple->SetMarkerStyle(8);
if (!side) {
sprintf(cSel,"z>0&&npulse>=%d",nPulseMin);
ntuple->Draw("y:x:npulse",cSel,"colz");
- gPad->SetTitle("A side");
} else {
sprintf(cSel,"z<0&&npulse>=%d",nPulseMin);
ntuple->Draw("y:x:npulse",cSel,"colz");
+ }
+
+ if (!side) {
+ gPad->SetTitle("A side");
+ } else {
gPad->SetTitle("C side");
}
+
ntuple->Write();
fileOut.Close();
file->Close();
gStyle->SetLabelOffset(-0.01,"Y");
gStyle->SetLabelOffset(-0.03,"Z");
- gPad->SetPhi(0.1);gPad->SetTheta(90);
-
his2D->GetXaxis()->SetTitle("max. undershot [ADC]");
his2D->GetYaxis()->SetTitle("width Reduction [%]");
his2D->DrawCopy(pOpt);
+
+ gPad->SetPhi(0.1);gPad->SetTheta(90);
his2D->~TH2F();
if (param[3]==param[4]) {param[3]=param[3]+0.0001;}
if (param[5]==param[4]) {param[5]=param[5]+0.0001;}
- if ((param[5]>param[4])&(param[5]>param[3])) {
+ if ((param[5]>param[4])&&(param[5]>param[3])) {
if (param[4]>=param[3]) {
vA1 = param[0]; vA2 = param[1]; vA3 = param[2];
vTT1 = param[3]; vTT2 = param[4]; vTT3 = param[5];
vA1 = param[1]; vA2 = param[0]; vA3 = param[2];
vTT1 = param[4]; vTT2 = param[3]; vTT3 = param[5];
}
- } else if ((param[4]>param[5])&(param[4]>param[3])) {
+ } else if ((param[4]>param[5])&&(param[4]>param[3])) {
if (param[5]>=param[3]) {
vA1 = param[0]; vA2 = param[2]; vA3 = param[1];
vTT1 = param[3]; vTT2 = param[5]; vTT3 = param[4];
vA1 = param[2]; vA2 = param[0]; vA3 = param[1];
vTT1 = param[5]; vTT2 = param[3]; vTT3 = param[4];
}
- } else if ((param[3]>param[4])&(param[3]>param[5])) {
+ } else if ((param[3]>param[4])&&(param[3]>param[5])) {
if (param[5]>=param[4]) {
vA1 = param[1]; vA2 = param[2]; vA3 = param[0];
vTT1 = param[4]; vTT2 = param[5]; vTT3 = param[3];