]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONESDInterface.cxx
Cuts updated.
[u/mrichter/AliRoot.git] / MUON / AliMUONESDInterface.cxx
index 3571b8f341d96aaac6f59b5cda125be91a8fe02d..1c7b95efbe75592ac02a0a953098ea3a46119114 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMUONLocalTrigger.h"
 #include "AliMUONTriggerTrack.h"
 #include "AliMUONVTriggerStore.h"
+#include "AliMUONVTriggerTrackStore.h"
 #include "AliMUON2DMapIterator.h"
 #include "AliMUONTrackParam.h"
 #include "AliMUONTrackExtrap.h"
@@ -80,6 +81,7 @@ TString AliMUONESDInterface::fgTrackStoreName = "AliMUONTrackStoreV1";
 TString AliMUONESDInterface::fgClusterStoreName = "AliMUONClusterStoreV2";
 TString AliMUONESDInterface::fgDigitStoreName = "AliMUONDigitStoreV2R";
 TString AliMUONESDInterface::fgTriggerStoreName = "AliMUONTriggerStoreV1";
+TString AliMUONESDInterface::fgTriggerTrackStoreName = "AliMUONTriggerTrackStoreV1";
 
 //_____________________________________________________________________________
 AliMUONESDInterface::AliMUONESDInterface()
@@ -523,6 +525,18 @@ AliMUONVTriggerStore* AliMUONESDInterface::NewTriggerStore()
   return reinterpret_cast<AliMUONVTriggerStore*>(classPtr->New());
 }
 
+//_____________________________________________________________________________
+AliMUONVTriggerTrackStore* AliMUONESDInterface::NewTriggerTrackStore()
+{
+  /// Create an empty trigger track store of type fgTriggerTrackStoreName
+  TClass* classPtr = TClass::GetClass(fgTriggerTrackStoreName);
+  if (!classPtr || !classPtr->InheritsFrom("AliMUONVTriggerTrackStore")) {
+    cout<<"E-AliMUONESDInterface::NewTriggerTrackStore: Unable to create store of type "<<fgTriggerTrackStoreName.Data()<<endl;
+    return 0x0;
+  }
+  return reinterpret_cast<AliMUONVTriggerTrackStore*>(classPtr->New());
+}
+
 //_________________________________________________________________________
 void AliMUONESDInterface::GetParamAtVertex(const AliESDMuonTrack& esdTrack, AliMUONTrackParam& trackParam)
 {
@@ -679,12 +693,12 @@ void AliMUONESDInterface::ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONTrac
   track.SetVertexErrXY2(0.,0.);
   track.SetGlobalChi2(esdTrack.GetChi2());
   track.SetMatchTrigger(esdTrack.GetMatchTrigger());
-  track.SetLoTrgNum(-1);
   track.SetChi2MatchTrigger(esdTrack.GetChi2MatchTrigger());
   track.SetHitsPatternInTrigCh(esdTrack.GetHitsPatternInTrigCh());
   track.SetLocalTrigger(esdTrack.LoCircuit(), esdTrack.LoStripX(), esdTrack.LoStripY(),
                        esdTrack.LoDev(), esdTrack.LoLpt(), esdTrack.LoHpt(),
                        esdTrack.GetTriggerWithoutChamber());
+  track.Connected(esdTrack.IsConnected());
   
   // track parameters at vertex
   AliMUONTrackParam paramAtVertex;
@@ -772,6 +786,7 @@ void AliMUONESDInterface::ESDToMUON(const AliESDMuonTrack& esdTrack, AliMUONLoca
     return;
   }
   
+  locTrg.SetUniqueID(locTrg.GetUniqueID());
   locTrg.SetLoCircuit(esdTrack.LoCircuit());
   locTrg.SetLoStripX(esdTrack.LoStripX());
   locTrg.SetLoStripY(esdTrack.LoStripY());
@@ -868,6 +883,13 @@ void AliMUONESDInterface::MUONToESD(const AliMUONTrack& track, AliESDMuonTrack&
   SetParamAtFirstCluster(*trackParam, esdTrack);
   SetParamCov(*trackParam, esdTrack);
   
+  // set transverse position at the end of the absorber
+  AliMUONTrackParam trackParamAtAbsEnd(*trackParam);
+  AliMUONTrackExtrap::ExtrapToZ(&trackParamAtAbsEnd, AliMUONConstants::AbsZEnd());
+  Double_t xAbs = trackParamAtAbsEnd.GetNonBendingCoor();
+  Double_t yAbs = trackParamAtAbsEnd.GetBendingCoor();
+  esdTrack.SetRAtAbsorberEnd(TMath::Sqrt(xAbs*xAbs + yAbs*yAbs));
+  
   // set param at vertex
   AliMUONTrackParam trackParamAtVtx(*trackParam);
   AliMUONTrackExtrap::ExtrapToVertex(&trackParamAtVtx, vertex[0], vertex[1], vertex[2], 0., 0.);
@@ -888,6 +910,9 @@ void AliMUONESDInterface::MUONToESD(const AliMUONTrack& track, AliESDMuonTrack&
     trackParam = static_cast<AliMUONTrackParam*>(track.GetTrackParamAtCluster()->After(trackParam));
   }
   
+  // set connected flag
+  esdTrack.Connected(track.IsConnected());
+  
   // set trigger info
   esdTrack.SetLocalTrigger(track.GetLocalTrigger());
   esdTrack.SetChi2MatchTrigger(track.GetChi2MatchTrigger());
@@ -950,6 +975,7 @@ void AliMUONESDInterface::MUONToESD(const AliMUONLocalTrigger& locTrg, AliESDMuo
     esdTrack.SetThetaYUncorrected(triggerTrack->GetThetay());
     esdTrack.SetNonBendingCoorUncorrected(triggerTrack->GetX11());
     esdTrack.SetBendingCoorUncorrected(triggerTrack->GetY11());
+    esdTrack.SetZUncorrected(triggerTrack->GetZ11());
   }
 }