,fROBPrevious(-1)
,fNumberClusters(1)
,fNumberClustersf(30)
+ ,fNumberClustersProcent(0.5)
+ ,fThresholdClustersDAQ(120.0)
+ ,fNumberRowDAQ(2)
+ ,fNumberColDAQ(4)
,fProcent(6.0)
,fDifference(17)
,fNumberTrack(0)
,fROBPrevious(c.fROBPrevious)
,fNumberClusters(c.fNumberClusters)
,fNumberClustersf(c.fNumberClustersf)
+ ,fNumberClustersProcent(c.fNumberClustersProcent)
+ ,fThresholdClustersDAQ(c.fThresholdClustersDAQ)
+ ,fNumberRowDAQ(c.fNumberRowDAQ)
+ ,fNumberColDAQ(c.fNumberColDAQ)
,fProcent(c.fProcent)
,fDifference(c.fDifference)
,fNumberTrack(c.fNumberTrack)
if(!fNormalizeNbOfCluster) fRelativeScale = 20.0;
else fRelativeScale = 1.18;
fNumberClustersf = fTimeMax;
- fNumberClusters = (Int_t)(0.5*fTimeMax);
+ fNumberClusters = (Int_t)(fNumberClustersProcent*fTimeMax);
// Init linear fitter
if(!fLinearFitterTracklet) {
////////////////////////////
Int_t nbli = 0;
AliTRDcluster *cl = 0x0;
+ //////////////////////////////
+ // Check no shared clusters
+ //////////////////////////////
+ for(int icc=AliTRDseedV1::kNtb; icc<AliTRDseedV1::kNclusters; icc++){
+ if((cl = tracklet->GetClusters(icc))) crossrow = 1;
+ }
+ //////////////////////////////////
+ // Loop clusters
+ //////////////////////////////////
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;
- }
+
}
////////////////////////////////////
//baseline = rawStream->GetCommonAdditive(); // common additive baseline
fNumberClustersf = fTimeMax;
- fNumberClusters = (Int_t)(0.6*fTimeMax);
+ fNumberClusters = (Int_t)(fNumberClustersProcent*fTimeMax);
Int_t *signal = rawStream->GetSignals(); // current ADC signal
fTimeMax = rawStream->GetNumberOfTimeBins(); // number of time bins read from data
fNumberClustersf = fTimeMax;
- fNumberClusters = (Int_t)(0.6*fTimeMax);
+ fNumberClusters = (Int_t)(fNumberClustersProcent*fTimeMax);
Int_t *signal = rawStream->GetSignals(); // current ADC signal
Int_t col = rawStream->GetCol();
Int_t row = rawStream->GetRow();
for (Int_t ic = 2; ic <= 142; ic++)
{
Double_t integral = 0;
- for (Int_t ishiftR = 0; ishiftR < 2; ishiftR++)
+ for (Int_t ishiftR = 0; ishiftR < fNumberRowDAQ; ishiftR++)
{
- for (Int_t ishiftC = -2; ishiftC < 2; ishiftC++)
+ for (Int_t ishiftC = -fNumberColDAQ; ishiftC < fNumberColDAQ; ishiftC++)
{
if (ir + ishiftR >= 1 && ir + ishiftR <= 16 &&
ic + ishiftC >= 1 && ic + ishiftC <= 144)
//printf("imaxRow %d, imaxCol %d, fTimeMax %d, integralMax %f\n",imaxRow,imaxCol,fTimeMax, integralMax);
- if((imaxRow == 0) || (imaxCol == 0)) {
+ //if((imaxRow == 0) || (imaxRow >= 15) || (imaxCol <= 3) || (imaxCol >= 140)) {
+ // used=1;
+ // return used;
+ // }
+
+ if(((imaxRow + fNumberRowDAQ) > 16) || (imaxRow == 0) || ((imaxCol - fNumberColDAQ) <= 1) || ((imaxCol + fNumberColDAQ) >= 144)) {
used=1;
return used;
}
// ////////////////////////////////////////////////////
- for (Int_t ir = imaxRow - 1; ir < imaxRow + 1; ir++)
+ for (Int_t ishiftR = 0; ishiftR < fNumberRowDAQ; ishiftR++)
{
- for (Int_t ic = imaxCol - 2; ic < imaxCol + 2; ic++)
+ for (Int_t ishiftC = -fNumberColDAQ; ishiftC < fNumberColDAQ; ishiftC++)
{
- for(Int_t it = 0; it < fTimeMax; it++){
- sum[it] += phvalue[ir][ic][it];
- }
- }//ic
- }//ir
+ if (imaxRow + ishiftR >= 1 && imaxRow + ishiftR <= 16 &&
+ imaxCol + ishiftC >= 1 && imaxCol + ishiftC <= 144)
+ {
+ for(Int_t it = 0; it < fTimeMax; it++){
+ sum[it] += phvalue[imaxRow + ishiftR-1][imaxCol + ishiftC-1][it];
+ }
+ }
+ } // col shift
+ }// row shift
Int_t nbcl = 0;
Double_t sumcharge = 0.0;
for(Int_t it = 0; it < fTimeMax; it++){
sumcharge += sum[it];
- if(sum[it] > 20.0) nbcl++;
+ if(sum[it] > fThresholdClustersDAQ) nbcl++;
}
"clustera="<<clustera<<
"it="<<it<<
"rms="<<rms<<
+ "nbcl="<<nbcl<<
"\n";
}
}
////////////////////////////////////////////////////////
// fill
///////////////////////////////////////////////////////
+ //printf("fNumberClusters %d, fNumberClustersf %d\n",fNumberClusters,fNumberClustersf);
if(sum[0] > 100.0) used = 1;
if(nbcl < fNumberClusters) used = 1;
if(nbcl > fNumberClustersf) used = 1;
for(Int_t it = 0; it < fTimeMax; it++){
if(fFillWithZero) UpdateDAQ(fDetectorPreviousTrack,0,0,it,sum[it],fTimeMax);
else{
- if(sum[it] > 0.0) UpdateDAQ(fDetectorPreviousTrack,0,0,it,sum[it],fTimeMax);
+ if(sum[it] > 0.0) UpdateDAQ(fDetectorPreviousTrack,0,0,it,sum[it],fTimeMax);
}
+ //if(fFillWithZero) UpdateDAQ(0,0,0,it,sum[it],fTimeMax);
+ //else{
+ // if(sum[it] > 0.0) UpdateDAQ(0,0,0,it,sum[it],fTimeMax);
+ //}
}
}
}
}
-
void SetDifference(Short_t difference) { fDifference = difference; }
void SetNumberClusters(Short_t numberClusters) { if(numberClusters >= 0) fNumberClusters = numberClusters; }
void SetNumberClustersf(Short_t numberClustersf) { fNumberClustersf = numberClustersf; }
+ void SetNumberClustersProcent(Float_t numberClustersProcent) { fNumberClustersProcent = numberClustersProcent; }
+ void SetThresholdClustersDAQ(Float_t thresholdClustersDAQ) { fThresholdClustersDAQ = thresholdClustersDAQ; }
+ void SetNumberRowDAQ(Short_t numberRowDAQ) { fNumberRowDAQ = numberRowDAQ; }
+ void SetNumberColDAQ(Short_t numberColDAQ) { fNumberColDAQ = numberColDAQ; }
void SetNumberBinCharge(Short_t numberBinCharge) { fNumberBinCharge = numberBinCharge; }
void SetNumberBinPRF(Short_t numberBinPRF) { fNumberBinPRF = numberBinPRF; }
void SetNumberGroupsPRF(Short_t numberGroupsPRF);
Int_t fROBPrevious; // Change of ROB
Short_t fNumberClusters; // Minimum number of clusters in the tracklets
Short_t fNumberClustersf; // Maximum number of clusters in the tracklets
+ Float_t fNumberClustersProcent; // Procent of number of time bins for fNumberClusters
+ Float_t fThresholdClustersDAQ; // Threshold clusters for DAQ algorithm
+ Short_t fNumberRowDAQ; // Size of the spot for DAQ algorithm
+ Short_t fNumberColDAQ; // Size of the spot for DAQ algorithm
Float_t fProcent; // Limit to take the info of the most important calibration group if the track goes through 2 groups (CH)
Short_t fDifference; // Limit to take the info of the most important calibration group if the track goes through 2 groups (CH)
Int_t fNumberTrack; // How many tracks could be used (Debug for the moment)
const char *name = ph->GetTitle();
if(!SetModeCalibration(name,1)) return kFALSE;
+ //printf("Mode calibration set\n");
+
// Number of Xbins (detectors or groups of pads)
Int_t nbins = ph->GetNbinsX();// time
Int_t nybins = ph->GetNbinsY();// calibration group
if (!InitFit(nybins,1)) {
return kFALSE;
}
+
+ //printf("Init fit\n");
+
if (!InitFitPH()) {
return kFALSE;
}
+
+ //printf("Init fit PH\n");
+
fStatisticMean = 0.0;
fNumberFit = 0;
fNumberFitSuccess = 0;
fNumberEnt = 0;
// Init fCountDet and fCount
InitfCountDetAndfCount(1);
+ //printf("Init Count Det and fCount %d, %d\n",fDect1,fDect2);
+
// Beginning of the loop
for (Int_t idect = fDect1; idect < fDect2; idect++) {
+ //printf("idect = %d\n",idect);
// Determination of fNnZ, fNnRphi, fNfragZ and fNfragRphi.......
UpdatefCountDetAndfCount(idect,1);
ReconstructFitRowMinRowMax(idect,1);
CalculVdriftCoefMean();
CalculT0CoefMean();
//Method choosen
+ //printf("Method\n");
switch(fMethod)
{
case 0: FitLagrangePoly((TH1 *) projph); break;
return kFALSE;
}
//______________________________________________________________________
+void AliTRDCalibraFit::RemoveOutliers(Int_t type, Bool_t perdetector){
+ //
+ // Remove the results too far from the mean value and rms
+ // type: 0 gain, 1 vdrift
+ // perdetector
+ //
+
+ Int_t loop = (Int_t) fVectorFit.GetEntriesFast();
+ if(loop != 540) {
+ AliInfo("The Vector Fit is not complete!");
+ return;
+ }
+ Int_t detector = -1;
+ Int_t sector = -1;
+ Float_t value = 0.0;
+
+ /////////////////////////////////
+ // Calculate the mean values
+ ////////////////////////////////
+ // Initialisation
+ ////////////////////////
+ Double_t meanAll = 0.0;
+ Double_t rmsAll = 0.0;
+ Int_t countAll = 0;
+ ////////////
+ // compute
+ ////////////
+ for (Int_t k = 0; k < loop; k++) {
+ detector = ((AliTRDFitInfo *) fVectorFit.At(k))->GetDetector();
+ sector = GetSector(detector);
+ if(perdetector){
+ value = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef()[0];
+ if(value > 0.0) {
+ rmsAll += value*value;
+ meanAll += value;
+ countAll++;
+ }
+ }
+ else {
+ Int_t rowMax = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
+ Int_t colMax = fGeo->GetColMax(GetLayer(detector));
+ for (Int_t row = 0; row < rowMax; row++) {
+ for (Int_t col = 0; col < colMax; col++) {
+ value = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef()[(Int_t)(col*rowMax+row)];
+ if(value > 0.0) {
+ rmsAll += value*value;
+ meanAll += value;
+ countAll++;
+ }
+
+ } // Col
+ } // Row
+ }
+ }
+ if(countAll > 0) {
+ meanAll = meanAll/countAll;
+ rmsAll = TMath::Sqrt(TMath::Abs(rmsAll/countAll - (meanAll*meanAll)));
+ }
+ //printf("RemoveOutliers: meanAll %f and rmsAll %f\n",meanAll,rmsAll);
+ /////////////////////////////////////////////////
+ // Remove outliers
+ ////////////////////////////////////////////////
+ Double_t defaultvalue = -1.0;
+ if(type==1) defaultvalue = -1.5;
+ for (Int_t k = 0; k < loop; k++) {
+ detector = ((AliTRDFitInfo *) fVectorFit.At(k))->GetDetector();
+ sector = GetSector(detector);
+ Int_t rowMax = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
+ Int_t colMax = fGeo->GetColMax(GetLayer(detector));
+ Float_t *coef = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef();
+
+ // remove the results too far away
+ for (Int_t row = 0; row < rowMax; row++) {
+ for (Int_t col = 0; col < colMax; col++) {
+ value = coef[(Int_t)(col*rowMax+row)];
+ if((value > 0.0) && (rmsAll > 0.0) && (TMath::Abs(value-meanAll) > (2*rmsAll))) {
+ coef[(Int_t)(col*rowMax+row)] = defaultvalue;
+ }
+ } // Col
+ } // Row
+ }
+}
+//______________________________________________________________________
+void AliTRDCalibraFit::RemoveOutliers2(Bool_t perdetector){
+ //
+ // Remove the results too far from the mean and rms
+ // perdetector
+ //
+
+ Int_t loop = (Int_t) fVectorFit2.GetEntriesFast();
+ if(loop != 540) {
+ AliInfo("The Vector Fit is not complete!");
+ return;
+ }
+ Int_t detector = -1;
+ Int_t sector = -1;
+ Float_t value = 0.0;
+
+ /////////////////////////////////
+ // Calculate the mean values
+ ////////////////////////////////
+ // Initialisation
+ ////////////////////////
+ Double_t meanAll = 0.0;
+ Double_t rmsAll = 0.0;
+ Int_t countAll = 0;
+ /////////////
+ // compute
+ ////////////
+ for (Int_t k = 0; k < loop; k++) {
+ detector = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetDetector();
+ sector = GetSector(detector);
+ if(perdetector){
+ value = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef()[0];
+ if(value < 70.0) {
+ meanAll += value;
+ rmsAll += value*value;
+ countAll++;
+ }
+ }
+ else {
+ Int_t rowMax = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
+ Int_t colMax = fGeo->GetColMax(GetLayer(detector));
+ for (Int_t row = 0; row < rowMax; row++) {
+ for (Int_t col = 0; col < colMax; col++) {
+ value = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef()[(Int_t)(col*rowMax+row)];
+ if(value < 70.0) {
+ rmsAll += value*value;
+ meanAll += value;
+ countAll++;
+ }
+ } // Col
+ } // Row
+ }
+ }
+ if(countAll > 0) {
+ meanAll = meanAll/countAll;
+ rmsAll = TMath::Sqrt(TMath::Abs(rmsAll/countAll - (meanAll*meanAll)));
+ }
+ //printf("Remove outliers 2: meanAll %f, rmsAll %f\n",meanAll,rmsAll);
+ /////////////////////////////////////////////////
+ // Remove outliers
+ ////////////////////////////////////////////////
+ for (Int_t k = 0; k < loop; k++) {
+ detector = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetDetector();
+ sector = GetSector(detector);
+ Int_t rowMax = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
+ Int_t colMax = fGeo->GetColMax(GetLayer(detector));
+ Float_t *coef = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef();
+
+ // remove the results too far away
+ for (Int_t row = 0; row < rowMax; row++) {
+ for (Int_t col = 0; col < colMax; col++) {
+ value = coef[(Int_t)(col*rowMax+row)];
+ if((value < 70.0) && (rmsAll > 0.0) && (TMath::Abs(value-meanAll) > (2.5*rmsAll))) coef[(Int_t)(col*rowMax+row)] = 100.0;
+ } // Col
+ } // Row
+ }
+}
+//______________________________________________________________________
void AliTRDCalibraFit::PutMeanValueOtherVectorFit(Int_t ofwhat, Bool_t perdetector){
//
// ofwhat is equaled to 0: mean value of all passing detectors
Double_t meanAll = 0.0;
Double_t meanSupermodule[18];
Double_t meanDetector[540];
+ Double_t rmsAll = 0.0;
+ Double_t rmsSupermodule[18];
+ Double_t rmsDetector[540];
Int_t countAll = 0;
Int_t countSupermodule[18];
Int_t countDetector[540];
for(Int_t sm = 0; sm < 18; sm++){
+ rmsSupermodule[sm] = 0.0;
meanSupermodule[sm] = 0.0;
countSupermodule[sm] = 0;
}
for(Int_t det = 0; det < 540; det++){
+ rmsDetector[det] = 0.0;
meanDetector[det] = 0.0;
countDetector[det] = 0;
}
+ ////////////
// compute
////////////
for (Int_t k = 0; k < loop; k++) {
if(perdetector){
value = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef()[0];
if(value > 0.0) {
+ rmsDetector[detector] += value*value;
meanDetector[detector] += value;
countDetector[detector]++;
+ rmsSupermodule[sector] += value*value;
meanSupermodule[sector] += value;
countSupermodule[sector]++;
+ rmsAll += value*value;
meanAll += value;
countAll++;
}
for (Int_t col = 0; col < colMax; col++) {
value = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef()[(Int_t)(col*rowMax+row)];
if(value > 0.0) {
+ rmsDetector[detector] += value*value;
meanDetector[detector] += value;
countDetector[detector]++;
+ rmsSupermodule[sector] += value*value;
meanSupermodule[sector] += value;
countSupermodule[sector]++;
+ rmsAll += value*value;
meanAll += value;
countAll++;
}
} // Row
}
}
- if(countAll > 0) meanAll = meanAll/countAll;
+ if(countAll > 0) {
+ meanAll = meanAll/countAll;
+ rmsAll = TMath::Abs(rmsAll/countAll - (meanAll*meanAll));
+ }
for(Int_t sm = 0; sm < 18; sm++){
- if(countSupermodule[sm] > 0) meanSupermodule[sm] = meanSupermodule[sm]/countSupermodule[sm];
+ if(countSupermodule[sm] > 0) {
+ meanSupermodule[sm] = meanSupermodule[sm]/countSupermodule[sm];
+ rmsSupermodule[sm] = TMath::Abs(rmsSupermodule[sm]/countSupermodule[sm] - (meanSupermodule[sm]*meanSupermodule[sm]));
+ }
}
for(Int_t det = 0; det < 540; det++){
- if(countDetector[det] > 0) meanDetector[det] = meanDetector[det]/countDetector[det];
+ if(countDetector[det] > 0) {
+ meanDetector[det] = meanDetector[det]/countDetector[det];
+ rmsDetector[det] = TMath::Abs(rmsDetector[det]/countDetector[det] - (meanDetector[det]*meanDetector[det]));
+ }
}
+ //printf("Put mean value, meanAll %f, rmsAll %f\n",meanAll,rmsAll);
+ ///////////////////////////////////////////////
// Put the mean value for the no-fitted
/////////////////////////////////////////////
for (Int_t k = 0; k < loop; k++) {
for (Int_t col = 0; col < colMax; col++) {
value = coef[(Int_t)(col*rowMax+row)];
if(value < 0.0) {
- if((ofwhat == 0) && (meanAll > 0.0)) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanAll);
+ if((ofwhat == 0) && (meanAll > 0.0) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanAll);
if(ofwhat == 1){
- if(meanDetector[detector] > 0.0) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanDetector[detector]);
- else if(meanSupermodule[sector] > 0.0) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanSupermodule[sector]);
- else if(meanAll > 0.0) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanAll);
+ if((meanDetector[detector] > 0.0) && (countDetector[detector] > 20)) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanDetector[detector]);
+ else if((meanSupermodule[sector] > 0.0) && (countSupermodule[sector] > 15)) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanSupermodule[sector]);
+ else if((meanAll > 0.0) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = -TMath::Abs(meanAll);
}
}
// Debug
} // Col
} // Row
}
-
}
//______________________________________________________________________
void AliTRDCalibraFit::PutMeanValueOtherVectorFit2(Int_t ofwhat, Bool_t perdetector){
// Initialisation
////////////////////////
Double_t meanAll = 0.0;
+ Double_t rmsAll = 0.0;
Double_t meanSupermodule[18];
+ Double_t rmsSupermodule[18];
Double_t meanDetector[540];
+ Double_t rmsDetector[540];
Int_t countAll = 0;
Int_t countSupermodule[18];
Int_t countDetector[540];
for(Int_t sm = 0; sm < 18; sm++){
+ rmsSupermodule[sm] = 0.0;
meanSupermodule[sm] = 0.0;
countSupermodule[sm] = 0;
}
for(Int_t det = 0; det < 540; det++){
+ rmsDetector[det] = 0.0;
meanDetector[det] = 0.0;
countDetector[det] = 0;
}
if(perdetector){
value = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef()[0];
if(value < 70.0) {
+ rmsDetector[detector] += value*value;
meanDetector[detector] += value;
countDetector[detector]++;
+ rmsSupermodule[sector] += value*value;
meanSupermodule[sector] += value;
countSupermodule[sector]++;
meanAll += value;
+ rmsAll += value*value;
countAll++;
}
}
for (Int_t col = 0; col < colMax; col++) {
value = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef()[(Int_t)(col*rowMax+row)];
if(value < 70.0) {
+ rmsDetector[detector] += value*value;
meanDetector[detector] += value;
countDetector[detector]++;
+ rmsSupermodule[sector] += value*value;
meanSupermodule[sector] += value;
countSupermodule[sector]++;
+ rmsAll += value*value;
meanAll += value;
countAll++;
}
} // Row
}
}
- if(countAll > 0) meanAll = meanAll/countAll;
+ if(countAll > 0) {
+ meanAll = meanAll/countAll;
+ rmsAll = TMath::Abs(rmsAll/countAll - (meanAll*meanAll));
+ }
for(Int_t sm = 0; sm < 18; sm++){
- if(countSupermodule[sm] > 0) meanSupermodule[sm] = meanSupermodule[sm]/countSupermodule[sm];
+ if(countSupermodule[sm] > 0) {
+ meanSupermodule[sm] = meanSupermodule[sm]/countSupermodule[sm];
+ rmsSupermodule[sm] = TMath::Abs(rmsSupermodule[sm]/countSupermodule[sm] - (meanSupermodule[sm]*meanSupermodule[sm]));
+ }
}
for(Int_t det = 0; det < 540; det++){
- if(countDetector[det] > 0) meanDetector[det] = meanDetector[det]/countDetector[det];
+ if(countDetector[det] > 0) {
+ meanDetector[det] = meanDetector[det]/countDetector[det];
+ rmsDetector[det] = TMath::Abs(rmsDetector[det]/countDetector[det] - (meanDetector[det]*meanDetector[det]));
+ }
}
+ //printf("Put mean value 2: meanAll %f, rmsAll %f\n",meanAll,rmsAll);
+ ////////////////////////////////////////////
// Put the mean value for the no-fitted
/////////////////////////////////////////////
for (Int_t k = 0; k < loop; k++) {
for (Int_t col = 0; col < colMax; col++) {
value = coef[(Int_t)(col*rowMax+row)];
if(value > 70.0) {
- if((ofwhat == 0) && (meanAll > -1.5)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
+ if((ofwhat == 0) && (meanAll > -1.5) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
if(ofwhat == 1){
- if(meanDetector[detector] > -1.5) coef[(Int_t)(col*rowMax+row)] = meanDetector[detector]+100.0;
- else if(meanSupermodule[sector] > -1.5) coef[(Int_t)(col*rowMax+row)] = meanSupermodule[sector]+100.0;
- else if(meanAll > -1.5) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
+ if((meanDetector[detector] > -1.5) && (countDetector[detector] > 20)) coef[(Int_t)(col*rowMax+row)] = meanDetector[detector]+100.0;
+ else if((meanSupermodule[sector] > -1.5) && (countSupermodule[sector] > 15)) coef[(Int_t)(col*rowMax+row)] = meanSupermodule[sector]+100.0;
+ else if((meanAll > -1.5) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
}
}
// Debug
if(fDebugLevel == 1) {
fCountDet = 0;
fCalibraMode->CalculXBins(fCountDet,i);
- while(fCalibraMode->GetXbins(i) <=fFitVoir){
+ if((fCalibraMode->GetNz(i)!=100) && (fCalibraMode->GetNrphi(i)!=100)){
+ while(fCalibraMode->GetXbins(i) <=fFitVoir){
+ fCountDet++;
+ fCalibraMode->CalculXBins(fCountDet,i);
+ //printf("GetXBins %d\n",fCalibraMode->GetXbins(i));
+ }
+ }
+ else {
fCountDet++;
- fCalibraMode->CalculXBins(fCountDet,i);
- }
+ }
fCount = fCalibraMode->GetXbins(i);
fCountDet--;
// Determination of fNnZ, fNnRphi, fNfragZ and fNfragRphi
//
// Slope methode but with polynomes de Lagrange
//
-
+
// Constants
const Float_t kDrWidth = AliTRDgeometry::DrThick();
Int_t binmax = 0;
(put)) {
fCurrentCoef[0] = (kDrWidth) / (fPhd[2]-fPhd[1]);
if(fCurrentCoef[0] > 2.5) fCurrentCoef[0] = -TMath::Abs(fCurrentCoef[1]);
- fNumberFitSuccess++;
+ else fNumberFitSuccess++;
if (fPhdt0 >= 0.0) {
fCurrentCoef2[0] = (fPhdt0 - t0Shift) / widbins;
if (fCurrentCoef2[0] < -1.0) {
AliTRDCalibraFit(const AliTRDCalibraFit &c);
AliTRDCalibraFit &operator=(const AliTRDCalibraFit &) { return *this; }
- // Function for integration range of the charge
- void RangeChargeIntegration(Float_t vdrift, Float_t t0, Int_t &begin, Int_t &peak, Int_t &end) const;
+ // Function for integration range of the charge
+ void RangeChargeIntegration(Float_t vdrift, Float_t t0, Int_t &begin, Int_t &peak, Int_t &end) const;
- // Functions fit for CH
- Bool_t AnalyseCH(const TH2I *ch);
- Bool_t AnalyseCH(AliTRDCalibraVector *calvect);
-
- // Functions fit for PH
- Bool_t AnalysePH(const TProfile2D *ph);
- Bool_t AnalysePH(AliTRDCalibraVector *calvect);
-
- // Functions fit for PRF
- Bool_t AnalysePRF(const TProfile2D *prf);
- Bool_t AnalysePRF(AliTRDCalibraVector *calvect);
-
- Bool_t AnalysePRFMarianFit(const TProfile2D *prf);
- Bool_t AnalysePRFMarianFit(AliTRDCalibraVector *calvect);
-
- // Functions fit for vdrift/lorentzangle
- Bool_t AnalyseLinearFitters(AliTRDCalibraVdriftLinearFit *calivdli);
-
- // Pad Calibration
- Bool_t SetModeCalibration(const char *name, Int_t i);
-
- //Reset Function
- void ResetVectorFit();
-
- // Some functions
- Double_t *CalculPolynomeLagrange2(const Double_t *x, const Double_t *y) const;
- Double_t *CalculPolynomeLagrange3(const Double_t *x, const Double_t *y) const;
- Double_t *CalculPolynomeLagrange4(const Double_t *x, const Double_t *y) const;
-
- // Fill the database
- void PutMeanValueOtherVectorFit(Int_t ofwhat = 1, Bool_t perdetector = kFALSE);
- void PutMeanValueOtherVectorFit2(Int_t ofwhat = 1, Bool_t perdetector = kFALSE);
- AliTRDCalDet *CreateDetObjectVdrift(const TObjArray *vectorFit, Bool_t perdetector = kFALSE);
- AliTRDCalDet *CreateDetObjectGain(const TObjArray *vectorFit, Bool_t meanOtherBefore=kTRUE, Double_t scaleFitFactor = 0.02431, Bool_t perdetector = kTRUE);
- AliTRDCalDet *CreateDetObjectT0(const TObjArray *vectorFit, Bool_t perdetector = kFALSE);
- AliTRDCalDet *CreateDetObjectLorentzAngle(const TObjArray *vectorFit);
-
- TObject *CreatePadObjectGain(const TObjArray *vectorFit = 0, Double_t scaleFitFactor = 1.0, const AliTRDCalDet *detobject = 0);
- TObject *CreatePadObjectVdrift(const TObjArray *vectorFit = 0, const AliTRDCalDet *detobject = 0);
- TObject *CreatePadObjectT0(const TObjArray *vectorFit = 0, const AliTRDCalDet *detobject = 0);
- TObject *CreatePadObjectPRF(const TObjArray *vectorFit);
-
- // Outliers stats
- AliTRDCalDet *MakeOutliersStatDet(const TObjArray *vectorFit, const char *name, Double_t &mean);
- TObject *MakeOutliersStatPad(const TObjArray *vectorFit, const char *name, Double_t &mean);
+ // Functions fit for CH
+ Bool_t AnalyseCH(const TH2I *ch);
+ Bool_t AnalyseCH(AliTRDCalibraVector *calvect);
+
+ // Functions fit for PH
+ Bool_t AnalysePH(const TProfile2D *ph);
+ Bool_t AnalysePH(AliTRDCalibraVector *calvect);
+
+ // Functions fit for PRF
+ Bool_t AnalysePRF(const TProfile2D *prf);
+ Bool_t AnalysePRF(AliTRDCalibraVector *calvect);
+
+ Bool_t AnalysePRFMarianFit(const TProfile2D *prf);
+ Bool_t AnalysePRFMarianFit(AliTRDCalibraVector *calvect);
+
+ // Functions fit for vdrift/lorentzangle
+ Bool_t AnalyseLinearFitters(AliTRDCalibraVdriftLinearFit *calivdli);
+
+ // Pad Calibration
+ Bool_t SetModeCalibration(const char *name, Int_t i);
+
+ //Reset Function
+ void ResetVectorFit();
+
+ // Some functions
+ Double_t *CalculPolynomeLagrange2(const Double_t *x, const Double_t *y) const;
+ Double_t *CalculPolynomeLagrange3(const Double_t *x, const Double_t *y) const;
+ Double_t *CalculPolynomeLagrange4(const Double_t *x, const Double_t *y) const;
+
+ // Fill the database
+ void RemoveOutliers(Int_t type, Bool_t perdetector = kFALSE);
+ void RemoveOutliers2(Bool_t perdetector = kFALSE);
+ void PutMeanValueOtherVectorFit(Int_t ofwhat = 1, Bool_t perdetector = kFALSE);
+ void PutMeanValueOtherVectorFit2(Int_t ofwhat = 1, Bool_t perdetector = kFALSE);
+ AliTRDCalDet *CreateDetObjectVdrift(const TObjArray *vectorFit, Bool_t perdetector = kFALSE);
+ AliTRDCalDet *CreateDetObjectGain(const TObjArray *vectorFit, Bool_t meanOtherBefore=kTRUE, Double_t scaleFitFactor = 0.02431, Bool_t perdetector = kTRUE);
+ AliTRDCalDet *CreateDetObjectT0(const TObjArray *vectorFit, Bool_t perdetector = kFALSE);
+ AliTRDCalDet *CreateDetObjectLorentzAngle(const TObjArray *vectorFit);
+
+ TObject *CreatePadObjectGain(const TObjArray *vectorFit = 0, Double_t scaleFitFactor = 1.0, const AliTRDCalDet *detobject = 0);
+ TObject *CreatePadObjectVdrift(const TObjArray *vectorFit = 0, const AliTRDCalDet *detobject = 0);
+ TObject *CreatePadObjectT0(const TObjArray *vectorFit = 0, const AliTRDCalDet *detobject = 0);
+ TObject *CreatePadObjectPRF(const TObjArray *vectorFit);
+
+ // Outliers stats
+ AliTRDCalDet *MakeOutliersStatDet(const TObjArray *vectorFit, const char *name, Double_t &mean);
+ TObject *MakeOutliersStatPad(const TObjArray *vectorFit, const char *name, Double_t &mean);
- //
- // Set or Get the variables
- //
+ //
+ // Set or Get the variables
+ //
+
+ // Fit
+ void ChooseMethod(Short_t method) { fMethod = method; }
+ void SetBeginFitCharge(Float_t beginFitCharge);
+ void SetPeriodeFitPH(Int_t periodeFitPH);
+ void SetTakeTheMaxPH() { fTakeTheMaxPH = kTRUE; }
+ void SetT0Shift0(Float_t t0Shift0);
+ void SetT0Shift1(Float_t t0Shift1);
+ void SetRangeFitPRF(Float_t rangeFitPRF);
+ void SetAccCDB() { fAccCDB = kTRUE; }
+ void SetMinEntries(Int_t minEntries);
+ void SetRebin(Short_t rebin);
+
+ Int_t GetPeriodeFitPH() const { return fFitPHPeriode; }
+ Bool_t GetTakeTheMaxPH() const { return fTakeTheMaxPH; }
+ Float_t GetT0Shift0() const { return fT0Shift0; }
+ Float_t GetT0Shift1() const { return fT0Shift1; }
+ Float_t GetRangeFitPRF() const { return fRangeFitPRF; }
+ Bool_t GetAccCDB() const { return fAccCDB; }
+ Int_t GetMinEntries() const { return fMinEntries; }
+ Short_t GetRebin() const { return fRebin; }
+
+ // Statistics
+ Int_t GetNumberFit() const { return fNumberFit; }
+ Int_t GetNumberFitSuccess() const { return fNumberFitSuccess; }
+ Int_t GetNumberEnt() const { return fNumberEnt; }
+ Double_t GetStatisticMean() const { return fStatisticMean; }
+
- // Fit
- void ChooseMethod(Short_t method) { fMethod = method; }
- void SetBeginFitCharge(Float_t beginFitCharge);
- void SetPeriodeFitPH(Int_t periodeFitPH);
- void SetTakeTheMaxPH() { fTakeTheMaxPH = kTRUE; }
- void SetT0Shift0(Float_t t0Shift0);
- void SetT0Shift1(Float_t t0Shift1);
- void SetRangeFitPRF(Float_t rangeFitPRF);
- void SetAccCDB() { fAccCDB = kTRUE; }
- void SetMinEntries(Int_t minEntries);
- void SetRebin(Short_t rebin);
-
- Int_t GetPeriodeFitPH() const { return fFitPHPeriode; }
- Bool_t GetTakeTheMaxPH() const { return fTakeTheMaxPH; }
- Float_t GetT0Shift0() const { return fT0Shift0; }
- Float_t GetT0Shift1() const { return fT0Shift1; }
- Float_t GetRangeFitPRF() const { return fRangeFitPRF; }
- Bool_t GetAccCDB() const { return fAccCDB; }
- Int_t GetMinEntries() const { return fMinEntries; }
- Short_t GetRebin() const { return fRebin; }
-
- // Statistics
- Int_t GetNumberFit() const { return fNumberFit; }
- Int_t GetNumberFitSuccess() const { return fNumberFitSuccess; }
- Int_t GetNumberEnt() const { return fNumberEnt; }
- Double_t GetStatisticMean() const { return fStatisticMean; }
-
-
- // Debug
- void SetDebugLevel(Short_t level) { fDebugLevel = level; }
- void SetDet(Int_t iLayer, Int_t iStack, Int_t iSector) { fDet[0] = iLayer;
+ // Debug
+ void SetDebugLevel(Short_t level) { fDebugLevel = level; }
+ void SetDet(Int_t iLayer, Int_t iStack, Int_t iSector) { fDet[0] = iLayer;
fDet[1] = iStack;
fDet[2] = iSector; }
void SetFitVoir(Int_t fitVoir) { fFitVoir = fitVoir; }
};
+ // Fit function
+ void FitLagrangePoly(TH1* projPH);
protected:
Bool_t FitPRFGausMI(Double_t *arraye,Double_t *arraym,Double_t *arrayme,Int_t nBins,Float_t xMin,Float_t xMax);
Double_t FitGausMI(Double_t *arraye,Double_t *arraym,Double_t *arrayme,Int_t nBins, Float_t xMin,Float_t xMax,TVectorD *param, Bool_t kError= kTRUE);
void FitPente(TH1 *projPH);
- void FitLagrangePoly(TH1* projPH);
void FitTnpRange(Double_t *arraye,Double_t *arraym,Double_t *arrayme,Int_t nbg,Int_t nybins);
TH1I *ReBin(const TH1I *hist) const;
TH1F *ReBin(const TH1F *hist) const;
Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
+ 6* 18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
Int_t nbfit = calibra->GetNumberFit();
+ Int_t nbfitSuccess = calibra->GetNumberFitSuccess();
Int_t nbE = calibra->GetNumberEnt();
// if enough statistics store the results
if ((nbtg > 0) &&
- (nbfit >= 0.5*nbE) && (nbE > 30)) {
+ (nbfit >= 0.5*nbE) && (nbE > 30) && (nbfitSuccess > 30)) {
// create the cal objects
+ calibra->RemoveOutliers(1,kTRUE);
calibra->PutMeanValueOtherVectorFit(1,kTRUE);
+ calibra->RemoveOutliers2(kTRUE);
calibra->PutMeanValueOtherVectorFit2(1,kTRUE);
TObjArray object = calibra->GetVectorFit();
AliTRDCalDet *objdriftvelocitydet = calibra->CreateDetObjectVdrift(&object,kTRUE);
Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
+ 6* 18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
Int_t nbfit = calibra->GetNumberFit();
+ Int_t nbfitSuccess = calibra->GetNumberFitSuccess();
Int_t nbE = calibra->GetNumberEnt();
// enough statistics
if ((nbtg > 0) &&
- (nbfit >= 0.5*nbE) && (nbE > 30)) {
+ (nbfit >= 0.5*nbE) && (nbE > 30) && (nbfitSuccess > 30)) {
// create the cal objects
+ calibra->RemoveOutliers(1,kTRUE);
calibra->PutMeanValueOtherVectorFit(1,kTRUE);
+ calibra->RemoveOutliers2(kTRUE);
calibra->PutMeanValueOtherVectorFit2(1,kTRUE);
TObjArray object = calibra->GetVectorFit();
AliTRDCalDet *objdriftvelocitydet = calibra->CreateDetObjectVdrift(&object,kTRUE);
//man->SetRun(0);
//Instance of AliTRDCalibraFillHisto
AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance();
+ calibra->SetNumberClustersProcent(0.9);
// everythings are okey for vdrift
Bool_t passvdrift = kTRUE; // if timebin okey
Int_t nbvdrift = 0; // number of events with entries for vdrift
if( ((Int_t)neventstotal)%1000 == 0 ) printf(" event number %d (physic event number %d) will be processed\n",(Int_t) neventstotal,(Int_t) neventsphysics);
-
/* use event - here, just write event id to result file */
eventT=event->eventType;