//
//////////////////////////////////////////////////////////////////////////////////////
-#include <TTree.h>
#include <TProfile2D.h>
#include <TProfile.h>
#include <TFile.h>
-#include <TChain.h>
#include <TStyle.h>
#include <TCanvas.h>
-#include <TGraphErrors.h>
#include <TObjArray.h>
#include <TObject.h>
#include <TH1F.h>
#include <TStopwatch.h>
#include <TMath.h>
#include <TDirectory.h>
-#include <TROOT.h>
#include <TTreeStream.h>
#include <TVectorD.h>
-#include <TF1.h>
#include "AliLog.h"
-#include "AliCDBManager.h"
#include "AliTRDCalibraFillHisto.h"
-#include "AliTRDCalibraFit.h"
#include "AliTRDCalibraMode.h"
#include "AliTRDCalibraVector.h"
#include "AliTRDCalibraVdriftLinearFit.h"
#include "AliTRDpadPlane.h"
#include "AliTRDcluster.h"
#include "AliTRDtrack.h"
-#include "AliTRDRawStreamV2.h"
+#include "AliTRDRawStream.h"
#include "AliRawReader.h"
#include "AliRawReaderDate.h"
#include "AliTRDgeometry.h"
fCalDetT0 = new AliTRDCalDet(*(cal->GetT0Det()));
// Calcul Xbins Chambd0, Chamb2
- Int_t Ntotal0 = CalculateTotalNumberOfBins(0);
- Int_t Ntotal1 = CalculateTotalNumberOfBins(1);
- Int_t Ntotal2 = CalculateTotalNumberOfBins(2);
+ Int_t ntotal0 = CalculateTotalNumberOfBins(0);
+ Int_t ntotal1 = CalculateTotalNumberOfBins(1);
+ Int_t ntotal2 = CalculateTotalNumberOfBins(2);
// If vector method On initialised all the stuff
if(fVector2d){
// Create the 2D histo
if (fHisto2d) {
- CreateCH2d(Ntotal0);
+ CreateCH2d(ntotal0);
}
// Variable
fAmpTotal = new Float_t[TMath::Max(fCalibraMode->GetDetChamb2(0),fCalibraMode->GetDetChamb0(0))];
fAmpTotal[k] = 0.0;
}
//Statistics
- fEntriesCH = new Int_t[Ntotal0];
- for(Int_t k = 0; k < Ntotal0; k++){
+ fEntriesCH = new Int_t[ntotal0];
+ for(Int_t k = 0; k < ntotal0; k++){
fEntriesCH[k] = 0;
}
// Create the 2D histo
if (fHisto2d) {
- CreatePH2d(Ntotal1);
+ CreatePH2d(ntotal1);
}
// Variable
fPHPlace = new Short_t[fTimeMax];
,fCalibraMode->GetNrphi(2)));
// Create the 2D histo
if (fHisto2d) {
- CreatePRF2d(Ntotal2);
+ CreatePRF2d(ntotal2);
}
}
// Calculate the total number of calibration groups
//
- Int_t Ntotal = 0;
+ Int_t ntotal = 0;
fCalibraMode->ModePadCalibration(2,i);
fCalibraMode->ModePadFragmentation(0,2,0,i);
fCalibraMode->SetDetChamb2(i);
- Ntotal += 6 * 18 * fCalibraMode->GetDetChamb2(i);
+ ntotal += 6 * 18 * fCalibraMode->GetDetChamb2(i);
fCalibraMode->ModePadCalibration(0,i);
fCalibraMode->ModePadFragmentation(0,0,0,i);
fCalibraMode->SetDetChamb0(i);
- Ntotal += 6 * 4 * 18 * fCalibraMode->GetDetChamb0(i);
- AliInfo(Form("Total number of Xbins: %d for i %d",Ntotal,i));
- return Ntotal;
+ ntotal += 6 * 4 * 18 * fCalibraMode->GetDetChamb0(i);
+ AliInfo(Form("Total number of Xbins: %d for i %d",ntotal,i));
+ return ntotal;
}
//____________Set the pad calibration variables for the detector_______________
}
//_____________________________________________________________________
-Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDRawStreamV2 *rawStream, Bool_t nocheck)
+Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDRawStream *rawStream, Bool_t nocheck)
{
//
- // Event Processing loop - AliTRDRawStreamV2
+ // Event Processing loop - AliTRDRawStream
// 0 timebin problem
// 1 no input
// 2 input
//row[iTimeBin] = rawStream->GetRow(); // current row
//col[iTimeBin] = rawStream->GetCol(); // current col
Int_t *signal = rawStream->GetSignals(); // current ADC signal
- //printf("detector %d, nbtimebin %d, iTimeBin %d\n",fDetectorPreviousTrack,nbtimebin,iTimeBin);
Int_t fin = TMath::Min(fTimeMax,(iTimeBin+3));
Int_t n = 0;
for(Int_t itime = iTimeBin; itime < fin; itime++){
// should extract baseline here!
if(signal[n]>13) phvalue[itime] = signal[n];
- //printf("signal is %d for %d\n",signal[n],n);
n++;
}
}
//row[iTimeBin] = rawStream->GetRow(); // current row
//col[iTimeBin] = rawStream->GetCol(); // current col
Int_t *signal = rawStream->GetSignals(); // current ADC signal
- //printf("detector %d, nbtimebin %d, iTimeBin %d\n",fDetectorPreviousTrack,nbtimebin,iTimeBin);
-
+
Int_t fin = TMath::Min(nbtimebin,(iTimeBin+3));
Int_t n = 0;
for(Int_t itime = iTimeBin; itime < fin; itime++){
// should extract baseline here!
if(signal[n]>13) phvalue[itime] = signal[n];
- //printf("signal is %d for %d\n",signal[n],n);
n++;
}
}
//
- AliTRDRawStreamV2 rawStream(rawReader);
+ AliTRDRawStream rawStream(rawReader);
rawReader->Select("TRD");
Double_t counter = 0;
//Debug
- TH1F *NbEntries = 0x0;//distribution of the number of entries
- TH1F *NbEntriesPerGroup = 0x0;//Number of entries per group
- TProfile *NbEntriesPerSp = 0x0;//Number of entries for one supermodule
+ TH1F *nbEntries = 0x0;//distribution of the number of entries
+ TH1F *nbEntriesPerGroup = 0x0;//Number of entries per group
+ TProfile *nbEntriesPerSp = 0x0;//Number of entries for one supermodule
// Beginning of the loop over the calibration groups
for (Int_t idect = 0; idect < nbins; idect++) {
//Debug
if(i > 1){
- if((!((Bool_t)NbEntries)) && (nentries > 0)){
- NbEntries = new TH1F("Number of entries","Number of entries"
+ if((!((Bool_t)nbEntries)) && (nentries > 0)){
+ nbEntries = new TH1F("Number of entries","Number of entries"
,100,(Int_t)nentries/2,nentries*2);
- NbEntries->SetDirectory(0);
- NbEntriesPerGroup = new TH1F("Number of entries per group","Number of entries per group"
+ nbEntries->SetDirectory(0);
+ nbEntriesPerGroup = new TH1F("Number of entries per group","Number of entries per group"
,nbins,0,nbins);
- NbEntriesPerGroup->SetDirectory(0);
- NbEntriesPerSp = new TProfile("Number of entries per supermodule","Number of entries per supermodule"
+ nbEntriesPerGroup->SetDirectory(0);
+ nbEntriesPerSp = new TProfile("Number of entries per supermodule","Number of entries per supermodule"
,(Int_t)(nbins/18),0,(Int_t)(nbins/18));
- NbEntriesPerSp->SetDirectory(0);
+ nbEntriesPerSp->SetDirectory(0);
}
- if(NbEntries){
- if(nentries > 0) NbEntries->Fill(nentries);
- NbEntriesPerGroup->Fill(idect+0.5,nentries);
- NbEntriesPerSp->Fill((idect%((Int_t)(nbins/18)))+0.5,nentries);
+ if(nbEntries){
+ if(nentries > 0) nbEntries->Fill(nentries);
+ nbEntriesPerGroup->Fill(idect+0.5,nentries);
+ nbEntriesPerSp->Fill((idect%((Int_t)(nbins/18)))+0.5,nentries);
}
}
TCanvas *stat = new TCanvas("stat","",50,50,600,800);
stat->Divide(2,1);
stat->cd(1);
- NbEntries->Draw("");
+ nbEntries->Draw("");
stat->cd(2);
- NbEntriesPerSp->SetStats(0);
- NbEntriesPerSp->Draw("");
+ nbEntriesPerSp->SetStats(0);
+ nbEntriesPerSp->Draw("");
TCanvas *stat1 = new TCanvas("stat1","",50,50,600,800);
stat1->cd();
- NbEntriesPerGroup->SetStats(0);
- NbEntriesPerGroup->Draw("");
+ nbEntriesPerGroup->SetStats(0);
+ nbEntriesPerGroup->Draw("");
}
return info;
//Number of points: if less than 3 return kFALSE
- Int_t Npoints = fListClusters->GetEntriesFast();
- if(Npoints <= 2) return kFALSE;
+ Int_t npoints = fListClusters->GetEntriesFast();
+ if(npoints <= 2) return kFALSE;
//Variables
TLinearFitter linearFitterTracklet = TLinearFitter(2,"pol1"); // TLinearFitter per tracklet
Float_t tnt = TMath::Tan(tiltingangle/180.*TMath::Pi()); // tan tiltingangle
//Fill with points
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
AliTRDcluster *cl = (AliTRDcluster *) fListClusters->At(k);
Double_t ycluster = cl->GetY();
}
(* fDebugStreamer) << "VDRIFT0"<<
- "Npoints="<<Npoints<<
+ "npoints="<<npoints<<
"\n";
(* fDebugStreamer) << "VDRIFT"<<
"snpright="<<snpright<<
- "Npoints="<<Npoints<<
+ "npoints="<<npoints<<
"nbli="<<nbli<<
"detector="<<detector<<
"snp="<<snp<<
}
- if(Npoints < fNumberClusters) return kFALSE;
+ if(npoints < fNumberClusters) return kFALSE;
if(snpright == 0) return kFALSE;
if(pointError >= 0.1) return kFALSE;
if(crossrow == 1) return kFALSE;
//
//Number of points
- Int_t Npoints = fListClusters->GetEntriesFast(); // number of total points
- Int_t Nb3pc = 0; // number of three pads clusters used for fit
+ Int_t npoints = fListClusters->GetEntriesFast(); // number of total points
+ Int_t nb3pc = 0; // number of three pads clusters used for fit
Int_t detector = ((AliTRDcluster *) fListClusters->At(0))->GetDetector(); // detector
// To see the difference due to the fit
Double_t *padPositions;
- padPositions = new Double_t[Npoints];
- for(Int_t k = 0; k < Npoints; k++){
+ padPositions = new Double_t[npoints];
+ for(Int_t k = 0; k < npoints; k++){
padPositions[k] = 0.0;
}
TLinearFitter fitter(2,"pol1");
fitter.StoreData(kFALSE);
fitter.ClearPoints();
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) fListClusters->At(k);
Short_t *signals = cl->GetSignals();
// Position of the cluster
Double_t padPosition = xcenter + cl->GetPadCol();
padPositions[k] = padPosition;
- Nb3pc++;
+ nb3pc++;
fitter.AddPoint(&time, padPosition,1);
}//clusters loop
- //printf("Nb3pc %d, Npoints %d\n",Nb3pc,Npoints);
- if(Nb3pc < 3) return kFALSE;
+ //printf("nb3pc %d, npoints %d\n",nb3pc,npoints);
+ if(nb3pc < 3) return kFALSE;
fitter.Eval();
TVectorD line(2);
fitter.GetParameters(line);
Float_t pointError = -1.0;
- pointError = TMath::Sqrt(fitter.GetChisquare()/Nb3pc);
+ pointError = TMath::Sqrt(fitter.GetChisquare()/nb3pc);
// Now fill the PRF
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) fListClusters->At(k);
Short_t *signals = cl->GetSignals(); // signal
Int_t chamber = GetChamber(detector); // chamber
Double_t xdiff = dpad; // reconstructed position constant
Double_t x = dpad; // reconstructed position moved
- Float_t Ep = pointError; // error of fit
+ Float_t ep = pointError; // error of fit
Float_t signal1 = (Float_t)signals[1]; // signal at the border
Float_t signal3 = (Float_t)signals[3]; // signal
Float_t signal2 = (Float_t)signals[2]; // signal
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"snp="<<snp<<
"tnp="<<tnp<<
"tgl="<<tgl<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
}
// some cuts
- if(Npoints < fNumberClusters) continue;
- if(Nb3pc <= 5) continue;
+ if(npoints < fNumberClusters) continue;
+ if(nb3pc <= 5) continue;
if((time >= 21) || (time < 7)) continue;
if(TMath::Abs(snp) >= 1.0) continue;
if(qcl < 80) continue;
//Number of points: if less than 3 return kFALSE
- Int_t Npoints = index1-index0;
- if(Npoints <= 2) return kFALSE;
+ Int_t npoints = index1-index0;
+ if(npoints <= 2) return kFALSE;
//Variables
TLinearFitter linearFitterTracklet = TLinearFitter(2,"pol1"); // TLinearFitter per tracklet
Float_t tnt = TMath::Tan(tiltingangle/180.*TMath::Pi()); // tan tiltingangle
//Fill with points
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
AliTRDcluster *cl = (AliTRDcluster *) t->GetCluster(k+index0);
Double_t ycluster = cl->GetY();
(* fDebugStreamer) << "VDRIFT"<<
//"snpright="<<snpright<<
- "Npoints="<<Npoints<<
+ "npoints="<<npoints<<
"nbli="<<nbli<<
"detector="<<detector<<
"snp="<<snp<<
}
- if(Npoints < fNumberClusters) return kFALSE;
+ if(npoints < fNumberClusters) return kFALSE;
//if(snpright == 0) return kFALSE;
if(pointError >= 0.1) return kFALSE;
if(crossrow == 1) return kFALSE;
//
//Number of points
- Int_t Npoints = index1-index0; // number of total points
- Int_t Nb3pc = 0; // number of three pads clusters used for fit
+ Int_t npoints = index1-index0; // number of total points
+ Int_t nb3pc = 0; // number of three pads clusters used for fit
Int_t detector = ((AliTRDcluster *) t->GetCluster(index0))->GetDetector(); // detector
// To see the difference due to the fit
Double_t *padPositions;
- padPositions = new Double_t[Npoints];
- for(Int_t k = 0; k < Npoints; k++){
+ padPositions = new Double_t[npoints];
+ for(Int_t k = 0; k < npoints; k++){
padPositions[k] = 0.0;
}
TLinearFitter fitter(2,"pol1");
fitter.StoreData(kFALSE);
fitter.ClearPoints();
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) t->GetCluster(k+index0);
Short_t *signals = cl->GetSignals();
// Position of the cluster
Double_t padPosition = xcenter + cl->GetPadCol();
padPositions[k] = padPosition;
- Nb3pc++;
+ nb3pc++;
fitter.AddPoint(&time, padPosition,1);
}//clusters loop
- //printf("Nb3pc %d, Npoints %d\n",Nb3pc,Npoints);
- if(Nb3pc < 3) return kFALSE;
+ //printf("nb3pc %d, npoints %d\n",nb3pc,npoints);
+ if(nb3pc < 3) return kFALSE;
fitter.Eval();
TVectorD line(2);
fitter.GetParameters(line);
Float_t pointError = -1.0;
- pointError = TMath::Sqrt(fitter.GetChisquare()/Nb3pc);
+ pointError = TMath::Sqrt(fitter.GetChisquare()/nb3pc);
// Take the tgl and snp with the track t now
Double_t tgl = t->GetTglPlane(GetPlane(detector)); //dz/dl and not dz/dx
// Now fill the PRF
- for(Int_t k = 0; k < Npoints; k++){
+ for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) t->GetCluster(k+index0);
Short_t *signals = cl->GetSignals(); // signal
Int_t chamber = GetChamber(detector); // chamber
Double_t xdiff = dpad; // reconstructed position constant
Double_t x = dpad; // reconstructed position moved
- Float_t Ep = pointError; // error of fit
+ Float_t ep = pointError; // error of fit
Float_t signal1 = (Float_t)signals[1]; // signal at the border
Float_t signal3 = (Float_t)signals[3]; // signal
Float_t signal2 = (Float_t)signals[2]; // signal
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"snp="<<snp<<
"tnp="<<tnp<<
"tgl="<<tgl<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
"detector="<<detector<<
"plane="<<plane<<
"chamber="<<chamber<<
- "Npoints="<<Npoints<<
- "Np="<<Nb3pc<<
- "Ep="<<Ep<<
+ "npoints="<<npoints<<
+ "Np="<<nb3pc<<
+ "ep="<<ep<<
"type="<<type<<
"snp="<<snp<<
"tnp="<<tnp<<
}
// some cuts
- if(Npoints < fNumberClusters) continue;
- if(Nb3pc <= 5) continue;
+ if(npoints < fNumberClusters) continue;
+ if(nb3pc <= 5) continue;
if((time >= 21) || (time < 7)) continue;
if(TMath::Abs(snp) >= 1.0) continue;
if(qcl < 80) continue;
,fCalibraMode->GetNrphi(1)));
// Calcul the number of Xbins
- Int_t Ntotal1 = 0;
+ Int_t ntotal1 = 0;
fCalibraMode->ModePadCalibration(2,1);
fCalibraMode->ModePadFragmentation(0,2,0,1);
fCalibraMode->SetDetChamb2(1);
- Ntotal1 += 6 * 18 * fCalibraMode->GetDetChamb2(1);
+ ntotal1 += 6 * 18 * fCalibraMode->GetDetChamb2(1);
fCalibraMode->ModePadCalibration(0,1);
fCalibraMode->ModePadFragmentation(0,0,0,1);
fCalibraMode->SetDetChamb0(1);
- Ntotal1 += 6 * 4 * 18 * fCalibraMode->GetDetChamb0(1);
- AliInfo(Form("Total number of Xbins: %d",Ntotal1));
+ ntotal1 += 6 * 4 * 18 * fCalibraMode->GetDetChamb0(1);
+ AliInfo(Form("Total number of Xbins: %d",ntotal1));
- CreatePH2d(Ntotal1);
+ CreatePH2d(ntotal1);
*/
CreatePH2d(540);