/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ //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 //PWG3/muon: #include "AliAnalysisTaskMuonTrackingEff.h" #include "AliCheckMuonDetEltResponse.h" //include STEER: #include "AliLog.h" #include "AliESDEvent.h" #include "AliTracker.h" #include "AliESDMuonTrack.h" //include MUON: #include "AliMUONTrack.h" #include "AliMUONTrackParam.h" #include "AliMUONTrackExtrap.h" #include "AliMUONVCluster.h" #include "AliMUONConstants.h" #include "AliMUONGeometryTransformer.h" #include "AliMUONESDInterface.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 #include #include #include #include #include #include #include #include /// \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; //_____________________________________________________________________________ AliCheckMuonDetEltResponse::AliCheckMuonDetEltResponse() : TObject(), fNCh(0), fNSt(0), fNDE(0), fTransformer(0x0), fESD(0x0), fTracksTotalNbr(0x0), fIsCosmicData(kFALSE), fTrackParams(0x0), fTrackParam(0x0), fCluster(0x0), fDetEltTDHistList(0x0), fDetEltTTHistList(0x0), fChamberTDHistList(0x0), fChamberTTHistList(0x0) { /// Default constructor fNCh = AliCheckMuonDetEltResponse::fNbrOfChamber; fNSt = AliCheckMuonDetEltResponse::fNbrOfStation; fNDE = AliAnalysisTaskMuonTrackingEff::fTotNbrOfDetectionElt; for (Int_t iCluster = 0; iCluster GetNumberOfMuonTracks(); fTrackParams = new TClonesArray(); ///Begininig of the loop: 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(); //!GetEntriesFast(); //!At(iTrackParam); fCluster = (AliMUONVCluster* ) fTrackParam ->GetClusterPtr(); fTrackFilter [fCluster->GetChamberId()] = 1; chamberResponse[fCluster->GetChamberId()] = 1; } for (Int_t station = 0; station < fNSt-1; ++station) { Int_t filter; //At(iTrackParam); fCluster = (AliMUONVCluster* ) fTrackParam ->GetClusterPtr(); newChamber = fCluster->GetChamberId(); detElt = fCluster->GetDetElemId(); ///Global and local positions calculation: posXG = fTrackParam->GetNonBendingCoor(); posYG = fTrackParam->GetBendingCoor(); posZG = fTrackParam->GetZ(); fTransformer->Global2Local(detElt, posXG, posYG, posZG, posXL, posYL, posZL); //! oldChamber + 1) //!UncheckedAt(iDet))->Fill(posXL, posYL); ((TH2F*) fDetEltTDHistList->UncheckedAt(fNDE))->Fill(chamber, 0); Int_t detEltLocalId = 0; //!UncheckedAt(chamber))->Fill(detEltLocalId); ((TH1F*) fChamberTDHistList->UncheckedAt(10))->Fill(chamber); } } //_____________________________________________________________________________ void AliCheckMuonDetEltResponse::FillTTHistos(Int_t chamber, Int_t detElt, Double_t posXL, Double_t posYL) { if(fTrackFilter[chamber] == 1) { Int_t iDet = 0; //!UncheckedAt(iDet)) -> Fill(posXL, posYL); ((TH2F*) fDetEltTTHistList->UncheckedAt(fNDE))->Fill(chamber, 0); Int_t detEltLocalId = 0; //!UncheckedAt(chamber))->Fill(detEltLocalId); ((TH1F*) fChamberTTHistList->UncheckedAt(10))->Fill(chamber); } } //_____________________________________________________________________________ Int_t AliCheckMuonDetEltResponse::FromDetElt2iDet(Int_t chamber, Int_t detElt) { /// ///Connexion between the detection element X and its position in the list of histograms iX. /// Int_t iDet = 0; //!3 && chamber<6) iDet = detElt-fOffset*(chamber+1)+18*(chamber-4)+16; if (chamber>5) iDet = detElt-fOffset*(chamber+1)+26*(chamber-6)+52; return iDet; } //_____________________________________________________________________________ Int_t AliCheckMuonDetEltResponse::FromDetElt2LocalId(Int_t chamber, Int_t detElt) { /// ///Connexion between the detection element X and its number in the station. /// Int_t localId = 0; //!GetNonBendingCoor(); //!GetBendingCoor(); //!GetNonBendingCoor(); //!GetBendingCoor(); //!Global2Local(deId, pos1[0], pos1[1], pos1[2], pos1[3], pos1[4], pos1[5]); //!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; if (chamber < 4) isMissed = CoordinatesInDetEltSt12(deId, posMiss[0], posMiss[1]); else isMissed = CoordinatesInDetEltSt345(deId, posMiss[0], posMiss[1]); 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) { // //Compute the coordinates of the missing cluster. //There are defined by the intersection between the straigth line joining two extrapolated points (1 and 2) and the detection element plane. //In the local coordinates, this means Z=0 in the parametric equation of the line. // Double_t t = 0; t = - z1 / (z2 - z1); x = t * (x2 - x1) + x1; y = t * (y2 - y1) + y1; } //_____________________________________________________________________________ Bool_t AliCheckMuonDetEltResponse::CoordinatesInDetEltSt345(Int_t DeId, Double_t x, Double_t y) { // //Return kTRUE if the coordinates are in the Detection Element, for station 3, 4 and 5. //This is done by checking if a pad correspond to the (x, y) position. // AliMpPad pad1; AliMpPad pad2; AliMpSlatSegmentation *segm1 = new AliMpSlatSegmentation(AliMpSegmentation::Instance(kFALSE)->GetSlat(DeId, AliMp::kCath0)); AliMpSlatSegmentation *segm2 = new AliMpSlatSegmentation(AliMpSegmentation::Instance(kFALSE)->GetSlat(DeId, AliMp::kCath1)); pad1 = segm1->PadByPosition(x, y, kFALSE); pad2 = segm2->PadByPosition(x, y, kFALSE); if (pad1.IsValid() && pad2.IsValid()) return kTRUE; else return kFALSE; } //_____________________________________________________________________________ Bool_t AliCheckMuonDetEltResponse::CoordinatesInDetEltSt12(Int_t DeId, Double_t x, Double_t y) { //Return kTRUE if the coordinates are in the Detection Element, for station 1 and 2. //This is done by checking if a pad correspond to the (x, y) position. AliMpPad pad1; AliMpPad pad2; AliMpSectorSegmentation *segm1 = new AliMpSectorSegmentation(AliMpSegmentation::Instance(kFALSE)->GetSector(DeId, AliMp::kCath0)); AliMpSectorSegmentation *segm2 = new AliMpSectorSegmentation(AliMpSegmentation::Instance(kFALSE)->GetSector(DeId, AliMp::kCath1)); pad1 = segm1->PadByPosition(x, y, kFALSE); pad2 = segm2->PadByPosition(x, y, kFALSE); if (pad1.IsValid() && pad2.IsValid()) return kTRUE; else return kFALSE; }