#include <TDirectory.h>
#include <TTreeStream.h>
#include <TVectorD.h>
+#include <TLinearFitter.h>
#include "AliLog.h"
:TObject()
,fGeo(0)
,fIsHLT(kFALSE)
- ,fMcmCorrectAngle(kFALSE)
,fCH2dOn(kFALSE)
,fPH2dOn(kFALSE)
,fPRF2dOn(kFALSE)
,fNumberTrack(0)
,fTimeMax(0)
,fSf(10.0)
- ,fNumberBinCharge(100)
- ,fNumberBinPRF(40)
- ,fNgroupprf(0)
+ ,fNumberBinCharge(50)
+ ,fNumberBinPRF(10)
+ ,fNgroupprf(3)
,fAmpTotal(0x0)
,fPHPlace(0x0)
,fPHValue(0x0)
:TObject(c)
,fGeo(0)
,fIsHLT(c.fIsHLT)
- ,fMcmCorrectAngle(c.fMcmCorrectAngle)
,fCH2dOn(c.fCH2dOn)
,fPH2dOn(c.fPH2dOn)
,fPRF2dOn(c.fPRF2dOn)
fCalibraVector->SetDetCha0(k,fCalibraMode->GetDetChamb0(k));
fCalibraVector->SetDetCha2(k,fCalibraMode->GetDetChamb2(k));
}
- TString namech("Nz");
- namech += fCalibraMode->GetNz(0);
- namech += "Nrphi";
- namech += fCalibraMode->GetNrphi(0);
- fCalibraVector->SetNameCH((const char* ) namech);
- TString nameph("Nz");
- nameph += fCalibraMode->GetNz(1);
- nameph += "Nrphi";
- nameph += fCalibraMode->GetNrphi(1);
- fCalibraVector->SetNamePH((const char* ) nameph);
- TString nameprf("Nz");
- nameprf += fCalibraMode->GetNz(2);
- nameprf += "Nrphi";
- nameprf += fCalibraMode->GetNrphi(2);
- nameprf += "Ngp";
- nameprf += fNgroupprf;
- fCalibraVector->SetNamePRF((const char* ) nameprf);
+ fCalibraVector->SetNzNrphi(0,fCalibraMode->GetNz(0),fCalibraMode->GetNrphi(0));
+ fCalibraVector->SetNzNrphi(1,fCalibraMode->GetNz(1),fCalibraMode->GetNrphi(1));
+ fCalibraVector->SetNzNrphi(2,fCalibraMode->GetNz(2),fCalibraMode->GetNrphi(2));
+ fCalibraVector->SetNbGroupPRF(fNgroupprf);
}
// Create the 2D histos corresponding to the pad groupCalibration mode
}
//____________Offline tracking in the AliTRDtracker____________________________
-Bool_t AliTRDCalibraFillHisto::UpdateHistograms(AliTRDtrack *t)
+Bool_t AliTRDCalibraFillHisto::UpdateHistograms(const AliTRDtrack *t)
{
//
// Use AliTRDtrack for the calibration
}
//____________Offline tracking in the AliTRDtracker____________________________
-Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t)
+Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t)
{
//
// Use AliTRDtrackV1 for the calibration
// loop over the clusters
////////////////////////////
Int_t nbclusters = 0;
- for(int jc=0; jc<AliTRDseed::kNtb; jc++){
+ for(int jc=0; jc<AliTRDseedV1::kNtb; jc++){
if(!(cl = tracklet->GetClusters(jc))) continue;
nbclusters++;
// Fill the stuffs if a good tracklet
////////////////////////////////////////
if (fGoodTracklet) {
-
+
// drift velocity unables to cut bad tracklets
Bool_t pass = FindP1TrackPHtrackletV1(tracklet, nbclusters);
+ //printf("pass %d and nbclusters %d\n",pass,nbclusters);
+
// Gain calibration
if (fCH2dOn) {
FillTheInfoOfTheTrackCH(nbclusters);
// Routine inside the update with AliTRDtrack
///////////////////////////////////////////////////////////////////////////////////
//____________Offine tracking in the AliTRDtracker_____________________________
-Bool_t AliTRDCalibraFillHisto::FindP1TrackPHtracklet(AliTRDtrack *t, Int_t index0, Int_t index1)
+Bool_t AliTRDCalibraFillHisto::FindP1TrackPHtracklet(const AliTRDtrack *t, Int_t index0, Int_t index1)
{
//
// Drift velocity calibration:
////////////////////////////
Int_t nbli = 0;
AliTRDcluster *cl = 0x0;
- for(int ic=0; ic<AliTRDseed::kNtb; ic++){
+ for(int ic=0; ic<AliTRDseedV1::kNtb; ic++){
if(!(cl = tracklet->GetClusters(ic))) continue;
if((fLimitChargeIntegration) && (!cl->IsInChamber())) continue;
fLinearFitterTracklet->AddPoint(&timeis,ycluster,1);
nbli++;
+ //////////////////////////////
+ // Check no shared clusters
+ //////////////////////////////
+ for(int icc=AliTRDseedV1::kNtb; icc<AliTRDseedV1::kNclusters; icc++){
+ if((cl = tracklet->GetClusters(icc))) crossrow = 1;
+ }
}
-
- //////////////////////////////
- // Check no shared clusters
- //////////////////////////////
-
- for(int ic=AliTRDseed::kNtb; ic<AliTRDseed::knTimebins; ic++){
- if((cl = tracklet->GetClusters(ic))) crossrow = 1;
- }
-
////////////////////////////////////
// Do the straight line fit now
return kTRUE;
}
//____________Offine tracking in the AliTRDtracker_____________________________
-Bool_t AliTRDCalibraFillHisto::HandlePRFtracklet(AliTRDtrack *t, Int_t index0, Int_t index1)
+Bool_t AliTRDCalibraFillHisto::HandlePRFtracklet(const AliTRDtrack *t, Int_t index0, Int_t index1)
{
//
// PRF width calibration
for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) t->GetCluster(k+index0);
+ if(!cl) continue;
Short_t *signals = cl->GetSignals();
- Double_t time = cl->GetLocalTimeBin();
+ Double_t time = cl->GetPadTime();
//Calculate x if possible
Float_t xcenter = 0.0;
Bool_t echec1 = kTRUE;
for(Int_t k = 0; k < npoints; k++){
//Take the cluster
AliTRDcluster *cl = (AliTRDcluster *) t->GetCluster(k+index0);
- Short_t *signals = cl->GetSignals(); // signal
- Double_t time = cl->GetLocalTimeBin(); // time bin
+ Short_t *signals = cl->GetSignals(); // signal
+ Double_t time = cl->GetPadTime(); // time bin
Float_t padPosTracklet = line[0]+line[1]*time; // reconstruct position from fit
Float_t padPos = cl->GetPadCol(); // middle pad
Double_t dpad = padPosTracklet - padPos; // reconstruct position relative to middle pad from fit
//////////////////////
Int_t nb3pc = 0; // number of three pads clusters used for fit
- Double_t *padPositions; // to see the difference between the fit and the 3 pad clusters position
- padPositions = new Double_t[AliTRDseed::kNtb];
- for(Int_t k = 0; k < AliTRDseed::kNtb; k++){
- padPositions[k] = 0.0;
- }
+ // to see the difference between the fit and the 3 pad clusters position
+ Double_t padPositions[AliTRDseedV1::kNtb];
+ memset(padPositions, 0, AliTRDseedV1::kNtb*sizeof(Double_t));
fLinearFitterTracklet->ClearPoints();
//printf("loop clusters \n");
// loop over the clusters
////////////////////////////
AliTRDcluster *cl = 0x0;
- for(int ic=0; ic<AliTRDseed::kNtb; ic++){
+ for(int ic=0; ic<AliTRDseedV1::kNtb; ic++){
// reject shared clusters on pad row
- if(((ic+AliTRDseed::kNtb) < AliTRDseed::knTimebins) && (cl = tracklet->GetClusters(ic+AliTRDseed::kNtb))) continue;
- //
+ if((ic+AliTRDseedV1::kNtb) < AliTRDseedV1::kNclusters) {
+ if((cl = tracklet->GetClusters(ic+AliTRDseedV1::kNtb))) continue;
+ }
if(!(cl = tracklet->GetClusters(ic))) continue;
-
-
- Double_t time = cl->GetLocalTimeBin();
+ Double_t time = cl->GetPadTime();
if((time<=7) || (time>=21)) continue;
Short_t *signals = cl->GetSignals();
Float_t xcenter = 0.0;
// fit with a straight line
/////////////////////////////
if(nb3pc < 3){
- delete [] padPositions;
fLinearFitterTracklet->ClearPoints();
- delete [] padPositions;
return kFALSE;
}
fLinearFitterTracklet->Eval();
////////////////////////////////////////////////
// Fill the PRF: Second loop over clusters
//////////////////////////////////////////////
- for(int ic=0; ic<AliTRDseed::kNtb; ic++){
+ for(int ic=0; ic<AliTRDseedV1::kNtb; ic++){
// reject shared clusters on pad row
- if(((ic+AliTRDseed::kNtb) < AliTRDseed::knTimebins) && (cl = tracklet->GetClusters(ic+AliTRDseed::kNtb))) continue;
+ if(((ic+AliTRDseedV1::kNtb) < AliTRDseedV1::kNclusters) && (cl = tracklet->GetClusters(ic+AliTRDseedV1::kNtb))) continue;
//
if(!(cl = tracklet->GetClusters(ic))) continue;
Short_t *signals = cl->GetSignals(); // signal
- Double_t time = cl->GetLocalTimeBin(); // time bin
+ Double_t time = cl->GetPadTime(); // time bin
Float_t padPosTracklet = line[0]+line[1]*time; // reconstruct position from fit
Float_t padPos = cl->GetPadCol(); // middle pad
Double_t dpad = padPosTracklet - padPos; // reconstruct position relative to middle pad from fit
} // second loop over clusters
- delete [] padPositions;
return kTRUE;
-
}
///////////////////////////////////////////////////////////////////////////////////////
// Pad row col stuff: see if masked or not
///////////////////////////////////////////////////////////////////////////////////////
//_____________________________________________________________________________
-void AliTRDCalibraFillHisto::CheckGoodTrackletV1(AliTRDcluster *cl)
+void AliTRDCalibraFillHisto::CheckGoodTrackletV1(const AliTRDcluster *cl)
{
//
// See if we are not near a masked pad
}
//_____________________________________________________________________________
-void AliTRDCalibraFillHisto::CheckGoodTrackletV0(Int_t detector, Int_t row, Int_t col)
+void AliTRDCalibraFillHisto::CheckGoodTrackletV0(const Int_t detector,const Int_t row,const Int_t col)
{
//
// See if we are not near a masked pad
// Per tracklet: store or reset the info, fill the histos with the info
//////////////////////////////////////////////////////////////////////////////////////////
//_____________________________________________________________________________
-void AliTRDCalibraFillHisto::StoreInfoCHPHtrack(AliTRDcluster *cl, Double_t dqdl, Int_t *group, Int_t row, Int_t col)
+void AliTRDCalibraFillHisto::StoreInfoCHPHtrack(const AliTRDcluster *cl,const Double_t dqdl,const Int_t *group,const Int_t row,const Int_t col)
{
//
// Store the infos in fAmpTotal, fPHPlace and fPHValue
// time bin of the cluster not corrected
Int_t time = cl->GetPadTime();
-
+ Float_t charge = TMath::Abs(cl->GetQ());
+
+ //printf("Store::time %d, amplitude %f\n",time,dqdl);
+
//Correct for the gain coefficient used in the database for reconstruction
Float_t correctthegain = 1.0;
if(fIsHLT) correctthegain = fCalDetGain->GetValue(fDetectorPreviousTrack);
// Fill the fAmpTotal with the charge
if (fCH2dOn) {
- if((!fLimitChargeIntegration) || (cl->IsInChamber())) fAmpTotal[(Int_t) group[0]] += correction;
+ if((!fLimitChargeIntegration) || (cl->IsInChamber())) {
+ //printf("Store::group %d, amplitude %f\n",group[0],correction);
+ fAmpTotal[(Int_t) group[0]] += correction;
+ }
}
// Fill the fPHPlace and value
if (fPH2dOn) {
fPHPlace[time] = group[1];
- fPHValue[time] = correction;
+ fPHValue[time] = charge;
}
}
Int_t fd = -1; // Premiere zone non nulle
Float_t totalcharge = 0.0; // Total charge for the supermodule histo
+ //printf("CH2d nbclusters %d, fNumberClusters %d, fNumberClustersf %d\n",nbclusters,fNumberClusters,fNumberClustersf);
+
if(nbclusters < fNumberClusters) return;
if(nbclusters > fNumberClustersf) return;
// Normalize with the number of clusters
Double_t normalizeCst = fRelativeScale;
if(fNormalizeNbOfCluster) normalizeCst = normalizeCst*nbclusters;
+
+ //printf("Number of groups in one detector %d\n",fCalibraMode->GetNfragZ(0)*fCalibraMode->GetNfragRphi(0));
// See if the track goes through different zones
for (Int_t k = 0; k < fCalibraMode->GetNfragZ(0)*fCalibraMode->GetNfragRphi(0); k++) {
+ //printf("fAmpTotal %f for %d\n",fAmpTotal[k],k);
if (fAmpTotal[k] > 0.0) {
totalcharge += fAmpTotal[k];
nb++;
}
}
+ //printf("CH2d: nb %d, fd %d, calibration group %d, amplitude %f, detector %d\n",nb,fd,fCalibraMode->GetXbins(0),fAmpTotal[fd]/normalizeCst,fDetectorPreviousTrack);
switch (nb)
{
// 0 timebin problem
// 1 no input
// 2 input
- //
// Same algorithm as TestBeam but different reader
//
//_________________________________________________________________________
Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(
#ifdef ALI_DATE
- eventHeaderStruct *event,
+ const eventHeaderStruct *event,
Bool_t nocheck
#else
- eventHeaderStruct* /*event*/,
+ const eventHeaderStruct* /*event*/,
Bool_t /*nocheck*/
#endif
}
}
}
-