//Class to check the response of the detection elements of the MUON tracking chambers
//in function of the position in the detection element.
//Author: Nicolas LE BRIS - SUBATECH Nantes
+//Modified by Matthieu LENHARDT - SUBATECH Nantes
-//PWG3/muon:
-#include "AliAnalysisTaskMuonTrackingEff.h"
+//PWG3/muondep:
#include "AliCheckMuonDetEltResponse.h"
//include STEER:
-#include "AliLog.h"
#include "AliESDEvent.h"
-#include "AliTracker.h"
#include "AliESDMuonTrack.h"
//include MUON:
#include "AliMUONTrackExtrap.h"
#include "AliMUONVCluster.h"
#include "AliMUONConstants.h"
-#include "AliMUONGeometryTransformer.h"
#include "AliMUONESDInterface.h"
+#include "AliMUONGeometryTransformer.h"
//include MUON/mapping:
#include "mapping/AliMpDEManager.h"
#include "mapping/AliMpSegmentation.h"
-#include "mapping/AliMpSlat.h"
#include "mapping/AliMpSlatSegmentation.h"
-#include "mapping/AliMpSector.h"
#include "mapping/AliMpSectorSegmentation.h"
#include "mapping/AliMpPad.h"
//include ROOT:
-#include <Riostream.h>
-#include <TMath.h>
-#include <TROOT.h>
-#include <TSystem.h>
#include <TH2F.h>
-#include <TH1F.h>
-#include <TClonesArray.h>
-#include <TPaveLabel.h>
#include <TList.h>
+#include <TObjArray.h>
/// \cond CLASSIMP
ClassImp(AliCheckMuonDetEltResponse)
/// \endcond
-const Int_t AliCheckMuonDetEltResponse::fNbrOfChamber = 10;
-const Int_t AliCheckMuonDetEltResponse::fNbrOfStation = 5;
-const Int_t AliCheckMuonDetEltResponse::fNbrOfDetectionElt[10] = {4, 4, 4, 4, 18, 18, 26, 26, 26, 26};
-const Int_t AliCheckMuonDetEltResponse::fFirstDetectionElt[10] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000};
-const Int_t AliCheckMuonDetEltResponse::fOffset = 100;
-const Int_t AliCheckMuonDetEltResponse::fOverlapSize = 15;
-const Int_t AliCheckMuonDetEltResponse::fYSlatSize = 20;
+const Int_t AliCheckMuonDetEltResponse::fgkNCh = AliMUONConstants::NTrackingCh();
+const Int_t AliCheckMuonDetEltResponse::fgkNSt = AliMUONConstants::NTrackingSt();
+const Int_t AliCheckMuonDetEltResponse::fgkNDE = 156;
+const Int_t AliCheckMuonDetEltResponse::fgkNbrOfDetectionElt[10] = {4, 4, 4, 4, 18, 18, 26, 26, 26, 26};
+const Int_t AliCheckMuonDetEltResponse::fgkFirstDetectionElt[10] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000};
+const Int_t AliCheckMuonDetEltResponse::fgkOffset = 100;
//_____________________________________________________________________________
AliCheckMuonDetEltResponse::AliCheckMuonDetEltResponse()
: TObject(),
- fNCh(0),
- fNSt(0),
- fNDE(0),
- fIsCosmicData(kFALSE),
- fTransformer(0x0),
+ fkTransformer(0x0),
fESD(0x0),
fTracksTotalNbr(0x0),
+ fNbrUsableTracks(0),
fTrackParams(0x0),
fTrackParam(0x0),
fCluster(0x0),
- fDetEltTDHistList(0x0),
- fDetEltTTHistList(0x0),
- fChamberTDHistList(0x0),
- fChamberTTHistList(0x0)
+ fDetEltTDHistList(0),
+ fDetEltTTHistList(0),
+ fChamberTDHistList(0),
+ fChamberTTHistList(0)
{
/// Default constructor
- fNCh = AliCheckMuonDetEltResponse::fNbrOfChamber;
- fNSt = AliCheckMuonDetEltResponse::fNbrOfStation;
- fNDE = AliAnalysisTaskMuonTrackingEff::fTotNbrOfDetectionElt;
+ fNbrUsableTracks = 0;
- for (Int_t iCluster = 0; iCluster<fNCh; ++iCluster)
+ for (Int_t iCluster = 0; iCluster<fgkNCh; ++iCluster)
fNbrClustersCh[iCluster] = 0;
- for (Int_t i=0; i<fNCh; ++i)
+ for (Int_t i=0; i<fgkNCh; ++i)
fTrackFilter[i] = 0;
}
//_____________________________________________________________________________
AliCheckMuonDetEltResponse::AliCheckMuonDetEltResponse(const AliCheckMuonDetEltResponse& src)
: TObject(src),
- fNCh(0),
- fNSt(0),
- fNDE(0),
- fIsCosmicData(kFALSE),
- fTransformer(0x0),
+ fkTransformer(0x0),
fESD(0x0),
fTracksTotalNbr(0x0),
+ fNbrUsableTracks(0),
fTrackParams(0x0),
fTrackParam(0x0),
fCluster(0x0),
- fDetEltTDHistList(0x0),
- fDetEltTTHistList(0x0),
- fChamberTDHistList(0x0),
- fChamberTTHistList(0x0)
+ fDetEltTDHistList(0),
+ fDetEltTTHistList(0),
+ fChamberTDHistList(0),
+ fChamberTTHistList(0)
{
src.Copy(*this);
}
//_____________________________________________________________________________
AliCheckMuonDetEltResponse::AliCheckMuonDetEltResponse(const AliMUONGeometryTransformer* transformer,
AliESDEvent* esd,
- TClonesArray* detEltTDHistList,
- TClonesArray* detEltTTHistList,
- TClonesArray* chamberTDHistList,
- TClonesArray* chamberTTHistList,
- Bool_t isCosmic)
+ TList* detEltTDHistList,
+ TList* detEltTTHistList,
+ TList* chamberTDHistList,
+ TList* chamberTTHistList)
: TObject(),
- fNCh(0),
- fNSt(0),
- fNDE(0),
- fIsCosmicData(kFALSE),
- fTransformer(transformer),
+ fkTransformer(transformer),
fESD(esd),
fTracksTotalNbr(0),
+ fNbrUsableTracks(0),
fTrackParams(0x0),
fTrackParam(0),
fCluster(0),
{
/// Constructor
- fNCh = AliCheckMuonDetEltResponse::fNbrOfChamber;
- fNSt = AliCheckMuonDetEltResponse::fNbrOfStation;
- fNDE = AliAnalysisTaskMuonTrackingEff::fTotNbrOfDetectionElt;
- fIsCosmicData = isCosmic;
+ fNbrUsableTracks = 0;
- for (Int_t iCluster = 0; iCluster<fNCh; ++iCluster)
+ for (Int_t iCluster = 0; iCluster<fgkNCh; ++iCluster)
fNbrClustersCh[iCluster] = 0;
- for (Int_t i=0; i<fNCh; ++i)
+ for (Int_t i=0; i<fgkNCh; ++i)
fTrackFilter[i] = 0;
-
}
{
/// Destructor
- delete fTrackParams;
}
//Loop on tracks
//--------------
- TrackLoop();
+ TrackLoop();
}
//_____________________________________________________________________________
void AliCheckMuonDetEltResponse::TrackLoop()
{
- AliESDMuonTrack* esdTrack;
- AliMUONTrack track;
- Int_t nTracks, iTrack;
-
- nTracks = (Int_t)fESD -> GetNumberOfMuonTracks();
- fTrackParams = new TClonesArray();
- ///Begininig of the loop:
+// Check if the track is kept
+ AliESDMuonTrack* esdTrack;
+ AliMUONTrack track;
+ Int_t nTracks, iTrack;
+
+ nTracks = (Int_t)fESD -> GetNumberOfMuonTracks();
+ ///Begininig of the loop:
+ //if (fESD->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL"))
+ {
for (iTrack = 0; iTrack < nTracks; iTrack++)
- {
- esdTrack = fESD -> GetMuonTrack(iTrack);
-
- if( esdTrack->ContainTrackerData() && esdTrack->GetMatchTrigger() > 0)
- {
- if (fIsCosmicData)
- {
- // Beginnig of long stuff to check the number of trigger hit (to only keep muon trigger and cut cosmic showers)
- Int_t nTriggerHit = 0;
- Int_t nTriggerHitStrip[8] = {0, 0, 0, 0,
- 0, 0, 0, 0};
- UShort_t triggerPattern[8] = {esdTrack->GetTriggerX1Pattern(), esdTrack->GetTriggerX2Pattern(), esdTrack->GetTriggerX3Pattern(), esdTrack->GetTriggerX4Pattern(),
- esdTrack->GetTriggerY1Pattern(), esdTrack->GetTriggerY2Pattern(), esdTrack->GetTriggerY3Pattern(), esdTrack->GetTriggerY4Pattern()};
-
- for (Int_t ii = 0; ii < 8; ii++)
- {
- UShort_t pattern = triggerPattern[ii];
- Int_t binaryValue[16] = {0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0};
-
- for (Int_t jj = 15; jj >= 0; jj--)
- {
- Int_t base = 1;
- for (Int_t bb = 0; bb < jj; bb++)
- base *= 2;
-
- if (pattern/base == 1)
- {
- binaryValue[jj] = 1;
- pattern = pattern - base;
- }
- }
- }
-
- for (Int_t ii = 0; ii < 8; ii++)
- nTriggerHit += nTriggerHitStrip[ii];
- // End of long stuff
-
-
- // Important part
- if (nTriggerHit < 10)
- {
- AliMUONESDInterface::ESDToMUON(*esdTrack, track);
- fTrackParams = track.GetTrackParamAtCluster();
- TrackParamLoop(); //!<Loop on trackParam.
- }
- }
-
- // No trigger cut is required for non-cosmic data
- else
- {
- AliMUONESDInterface::ESDToMUON(*esdTrack, track);
- fTrackParams = track.GetTrackParamAtCluster();
- TrackParamLoop(); //!<Loop on trackParam.
- }
- }
- }
+ {
+ esdTrack = fESD -> GetMuonTrack(iTrack);
+
+ if(esdTrack->ContainTrackerData() && esdTrack->GetMatchTrigger() > 0)
+ {
+ AliMUONESDInterface::ESDToMUON(*esdTrack, track);
+ fTrackParams = track.GetTrackParamAtCluster();
+ TrackParamLoop(); //!<Loop on trackParam.
+ fNbrUsableTracks += 1;
+ }
+ }
+ }
}
//_____________________________________________________________________________
void AliCheckMuonDetEltResponse::TrackParamLoop()
{
+// Loop on all the track params and fill the histos
Int_t nTrackParams = (Int_t) fTrackParams->GetEntriesFast(); //!<Number of trackParams in the track.
Int_t iTrackParam = 0; //!<Number of the trackParam of the track.
Int_t oldChamber = -1, newChamber = 0; //!<To check if there is 0, 1 or 2 (overlap cases) clusters in the same chamber for a track.
Int_t detElt; //!<Detection element Id.
- for (Int_t ch = 0; ch < fNCh; ++ch)
- {
- fTrackFilter[ch] = 0;
- }
+ for (Int_t ch = 0; ch < fgkNCh; ++ch)
+ fTrackFilter[ch] = 0;
Double_t posXL, posYL, posZL; //!<Local positions.
Double_t posXG, posYG, posZG; //!<Global. positions.
fTrackFilter [fCluster->GetChamberId()] = 1;
chamberResponse[fCluster->GetChamberId()] = 1;
}
-
- for (Int_t station = 0; station < fNSt-1; ++station)
- {
- Int_t filter; //<!
- Int_t ch1, ch2, ch3, ch4; //<!
- ch1 = 2*station; //<!
- ch2 = 2*station + 1; //<!
- ch3 = 2*station + 2; //<!
- ch4 = 2*station + 3; //<!
- //<!For the efficiency calculation the tracks
- if (station < 3 ) //<!reconstructed must have responded to the
- { //<!criteria of the tracking.
- filter = fTrackFilter[ch1]; //<!And that's why the tracks usable for the
- fTrackFilter[ch1] = fTrackFilter[ch2]; //<!intrinsic efficiency calculation are
- fTrackFilter[ch2] = filter; //<!the tracks which have one or two clusters
- } //<!in each station. So the case where a track
- //<!hasn't a cluster in a station is not
- else //<!taking into account.
- { //<!This part solves the problem. See the ALICE
- if (chamberResponse[ch3]*chamberResponse[ch4] != 0) //<!note of Diego STOCCO on the trigger efficiency
- { //<!
- filter = fTrackFilter[ch1]; //<!
- fTrackFilter[ch1] = fTrackFilter[ch2]; //<!
- fTrackFilter[ch2] = filter; //<!
- } //<!
- else //<!
- { //<!
- fTrackFilter[ch1] = 0; //<!
- fTrackFilter[ch2] = 0; //<!
- } //<!
- //<!
- if (chamberResponse[ch1]*chamberResponse[ch2] != 0) //<!
- { //<!
- filter = fTrackFilter[ch3]; //<!
- fTrackFilter[ch3] = fTrackFilter[ch4]; //<!
- fTrackFilter[ch4] = filter; //<!
- } //<!
- else //<!
- { //<!
- fTrackFilter[ch3] = 0; //<!
- fTrackFilter[ch4] = 0; //<!
- } //<!
- } //<!
- } //<!
-
- for (Int_t ch = 0; ch < fNCh; ++ch)
+ for (Int_t station = 0; station < fgkNSt-1; ++station)
{
- if (fTrackFilter[ch] == 1)
- {
- if ( chamberResponse[ch] != 0)
+ Int_t filter; //<!
+ Int_t ch1, ch2, ch3, ch4; //<!
+ ch1 = 2*station; //<!
+ ch2 = 2*station + 1; //<!
+ ch3 = 2*station + 2; //<!
+ ch4 = 2*station + 3; //<!
+ //<!For the efficiency calculation the tracks
+ if (station < 3 ) //<!reconstructed must have responded to the
+ { //<!criteria of the tracking.
+ filter = fTrackFilter[ch1]; //<!And that's why the tracks usable for the
+ fTrackFilter[ch1] = fTrackFilter[ch2]; //<!intrinsic efficiency calculation are
+ fTrackFilter[ch2] = filter; //<!the tracks which have one or two clusters
+ } //<!in each station. So the case where a track
+ //<!hasn't a cluster in a station is not
+ else //<!taking into account.
+ { //<!This part solves the problem. See the ALICE
+ if (chamberResponse[ch3]*chamberResponse[ch4] != 0) //<!note of Diego STOCCO on the trigger efficiency
+ { //<!
+ filter = fTrackFilter[ch1]; //<!
+ fTrackFilter[ch1] = fTrackFilter[ch2]; //<!
+ fTrackFilter[ch2] = filter; //<!
+ } //<!
+ else //<!
+ { //<!
+ fTrackFilter[ch1] = 0; //<!
+ fTrackFilter[ch2] = 0; //<!
+ } //<!
+
+ if (chamberResponse[ch1]*chamberResponse[ch2] != 0)
{
- ((TH2F*) fDetEltTDHistList->UncheckedAt(fNDE))->Fill(ch, 0);
- ((TH1F*) fChamberTDHistList->UncheckedAt(fNCh))->Fill(ch);
+ filter = fTrackFilter[ch3];
+ fTrackFilter[ch3] = fTrackFilter[ch4];
+ fTrackFilter[ch4] = filter;
+ }
+ else
+ {
+ fTrackFilter[ch3] = 0;
+ fTrackFilter[ch4] = 0;
}
-
- ((TH2F*) fDetEltTTHistList->UncheckedAt(fNDE))->Fill(ch, 0);
- ((TH1F*) fChamberTTHistList->UncheckedAt(fNCh))->Fill(ch);
}
- }
+ }
+
///Begining of the loop:
for (iTrackParam = 0; iTrackParam < nTrackParams; ++iTrackParam)
{
posYG = fTrackParam->GetBendingCoor();
posZG = fTrackParam->GetZ();
- fTransformer->Global2Local(detElt, posXG, posYG, posZG, posXL, posYL, posZL); //!<Transfomation from global to local positions.
+ fkTransformer->Global2Local(detElt, posXG, posYG, posZG, posXL, posYL, posZL); //!<Transfomation from global to local positions.
///Filling histograms of the cluster positions on the detection element of the TRACKS DETECTED (TD):
FillTDHistos(newChamber, detElt, posXL, posYL);
FindAndFillMissedDetElt(fTrackParam, oldChamber+1, nbrMissChamber); //!<Calculation of the parameters of the missing cluster(s).
}
- if ( iTrackParam == nTrackParams - 1 && newChamber != fNCh-1) //!<Check if the last chamber, chamber 9 (from 0 to 9) has responded.
- {
- FindAndFillMissedDetElt(fTrackParam, fNCh-1, 1); //!<Calculation of the parameters of the missing cluster(s) in the last chamber.
- }
+ if ( iTrackParam == nTrackParams - 1 && newChamber != fgkNCh-1) //!<Check if the last chamber, chamber 9 (from 0 to 9) has responded.
+ FindAndFillMissedDetElt(fTrackParam, fgkNCh-1, 1); //!<Calculation of the parameters of the missing cluster(s) in the last chamber.
+
}
oldChamber = newChamber;
}
Double_t posXL,
Double_t posYL)
{
+// Fill the histo for tracks detected
if(fTrackFilter[chamber]== 1)
{
Int_t iDet = 0; //!<Position of the detection element in the histograms' list.
iDet = FromDetElt2iDet(chamber, detElt);
- ((TH2F*) fDetEltTDHistList->UncheckedAt(iDet))->Fill(posXL, posYL);
-
+ ((TH2F*) fDetEltTDHistList->At(iDet))->Fill(posXL, posYL);
+
Int_t detEltLocalId = 0; //!<Id of the detection element in the station
detEltLocalId = FromDetElt2LocalId(chamber, detElt);
- ((TH1F*) fChamberTDHistList->UncheckedAt(chamber))->Fill(detEltLocalId);
- }
+ ((TH1F*) fChamberTDHistList->At(chamber))->Fill(detEltLocalId);
+ ((TH1F*) fChamberTDHistList->At(fgkNCh))->Fill(chamber + 1);
+ }
}
Double_t posXL,
Double_t posYL)
{
+// Fill the histo for total number of tracks
if(fTrackFilter[chamber] == 1)
{
Int_t iDet = 0; //!<Position of the detection element in the histograms' list.
iDet = FromDetElt2iDet(chamber, detElt);
- ((TH2F*) fDetEltTTHistList->UncheckedAt(iDet)) -> Fill(posXL, posYL);
-
+ ((TH2F*) fDetEltTTHistList->At(iDet)) -> Fill(posXL, posYL);
+
Int_t detEltLocalId = 0; //!<Id of the detection element in the station
detEltLocalId = FromDetElt2LocalId(chamber, detElt);
- ((TH1F*) fChamberTTHistList->UncheckedAt(chamber))->Fill(detEltLocalId);
+ ((TH1F*) fChamberTTHistList->At(chamber))->Fill(detEltLocalId);
+ ((TH1F*) fChamberTTHistList->At(fgkNCh))->Fill(chamber + 1);
}
}
//_____________________________________________________________________________
Int_t AliCheckMuonDetEltResponse::FromDetElt2iDet(Int_t chamber,
- Int_t detElt)
+ Int_t detElt) const
{
///
///Connexion between the detection element X and its position in the list of histograms iX.
Int_t iDet = 0; //!<Position of the detection element (detElt) in the histograms' list.
- if (chamber<4) iDet = detElt-fOffset*(chamber+1)+ 4* chamber ;
- if (chamber>3 && chamber<6) iDet = detElt-fOffset*(chamber+1)+18*(chamber-4)+16;
- if (chamber>5) iDet = detElt-fOffset*(chamber+1)+26*(chamber-6)+52;
+ if (chamber<4) iDet = detElt-fgkOffset*(chamber+1)+ 4* chamber ;
+ if (chamber>3 && chamber<6) iDet = detElt-fgkOffset*(chamber+1)+18*(chamber-4)+16;
+ if (chamber>5) iDet = detElt-fgkOffset*(chamber+1)+26*(chamber-6)+52;
return iDet;
}
//_____________________________________________________________________________
Int_t AliCheckMuonDetEltResponse::FromDetElt2LocalId(Int_t chamber,
- Int_t detElt)
+ Int_t detElt) const
{
///
///Connexion between the detection element X and its number in the station.
for (Int_t iDE = 0; iDE < nbrOfDetElt; iDE++) //!<Loop on all the detection element of the chamber
{
- Int_t deId = (chamber + 1)*fOffset + iDE; //!<detection element Id
+ Int_t deId = (chamber + 1)*fgkOffset + iDE; //!<detection element Id
- fTransformer->Global2Local(deId, pos1[0], pos1[1], pos1[2], pos1[3], pos1[4], pos1[5]); //!<convesrion of point 1 and 2 in the local coordinates
- fTransformer->Global2Local(deId, pos2[0], pos2[1], pos2[2], pos2[3], pos2[4], pos2[5]);
+ fkTransformer->Global2Local(deId, pos1[0], pos1[1], pos1[2], pos1[3], pos1[4], pos1[5]); //!<convesrion of point 1 and 2 in the local coordinates
+ fkTransformer->Global2Local(deId, pos2[0], pos2[1], pos2[2], pos2[3], pos2[4], pos2[5]);
CoordinatesOfMissingCluster(pos1[3], pos1[4], pos1[5], pos2[3], pos2[4], pos2[5], posMiss[0], posMiss[1]);
- Bool_t IsMissed = kFALSE;
+ Bool_t isMissed = kFALSE;
if (chamber < 4)
- IsMissed = CoordinatesInDetEltSt12(deId, posMiss[0], posMiss[1]);
+ isMissed = CoordinatesInDetEltSt12(deId, posMiss[0], posMiss[1]);
else
- IsMissed = CoordinatesInDetEltSt345(deId, posMiss[0], posMiss[1]);
+ isMissed = CoordinatesInDetEltSt345(deId, posMiss[0], posMiss[1]);
- if (IsMissed)
+ if (isMissed)
FillTTHistos(chamber, deId, posMiss[0], posMiss[1]);
-
}
}
}
//_____________________________________________________________________________
void AliCheckMuonDetEltResponse::CoordinatesOfMissingCluster(Double_t x1, Double_t y1, Double_t z1,
Double_t x2, Double_t y2, Double_t z2,
- Double_t& x, Double_t& y)
+ Double_t& x, Double_t& y) const
{
//
//Compute the coordinates of the missing cluster.
pad1 = segm1->PadByPosition(x, y, kFALSE);
pad2 = segm2->PadByPosition(x, y, kFALSE);
- if (pad1.IsValid() || pad2.IsValid())
+ if (pad1.IsValid() && pad2.IsValid())
return kTRUE;
else
return kFALSE;
pad1 = segm1->PadByPosition(x, y, kFALSE);
pad2 = segm2->PadByPosition(x, y, kFALSE);
- if (pad1.IsValid() || pad2.IsValid())
+ if (pad1.IsValid() && pad2.IsValid())
return kTRUE;
else
return kFALSE;