1 #ifndef ALISPDMCTRACKDENSITY_MC
2 #define ALISPDMCTRACKDENSITY_MC
3 #include <AliBaseMCTrackDensity.h>
6 * A class to calculate the particle density from track references.
7 * This code is used both in AliForwardMCCorrectionsTask and
8 * AliSPDMCDensity calculator.
11 * - AliMultiplicity object - from reconstruction
16 * - AliESDSPD object - content is # of track references/strip
18 * @par Corrections used:
22 * - Incident angle vs number of track references
23 * - Incident angle vs number of strips/cluster
25 * @ingroup pwglf_forward_algo
26 * @ingroup pwglf_forward_mc
27 * @ingroup pwglf_forward_aod
29 class AliSPDMCTrackDensity : public AliBaseMCTrackDensity
33 * Default constructor. Do not use - for ROOT I/O system use only
35 AliSPDMCTrackDensity();
39 * @param name Not used
41 AliSPDMCTrackDensity(const char* name);
45 * @param o Object to copy from
47 AliSPDMCTrackDensity(const AliSPDMCTrackDensity& o);
51 * @param o Object to assign from
53 * @return Reference to this
55 AliSPDMCTrackDensity& operator=(const AliSPDMCTrackDensity& o);
59 virtual ~AliSPDMCTrackDensity() {}
62 * Loops over all the particles in the passed event. If @a primary
63 * is not null, then that histogram is filled with the primary
64 * particle information - irrespective of whether the particle
65 * actually hits the SPD or not. For each track (primary or
66 * secondary, unless only primary information is requested - see
67 * SetUseOnlyPrimary) loop over all track references to that
68 * particle and check if they come from the SPD. In that case,
69 * figure out which @f$(\eta,\varphi)@f$-bin to assign the track to,
70 * and fill the @a output histogram
72 * @param event MC event
73 * @param vz IP z--coordinate
74 * @param output Output of SPD hits
75 * @param primary Primary information, if available.
79 Bool_t Calculate(const AliMCEvent& event,
83 void Print(Option_t* option="") const;
86 * Must be defined to return the track-reference ID for this detector
88 * @return Detector id set on track references
90 Int_t GetDetectorId() const;
92 * Process a track reference
94 * @param particle Particle
95 * @param mother Ultimate mother (if not primary)
96 * @param ref Reference
98 * @return 0 if no output should be generated for this reference, or
99 * pointer to track-reference to produce output for.
101 AliTrackReference* ProcessRef(AliMCParticle* particle,
102 const AliMCParticle* mother,
103 AliTrackReference* ref);
105 * Called at before loop over track references
108 void BeginTrackRefs();
109 Bool_t CheckTrackRef(AliTrackReference* /*ref*/) const;
111 * Store a particle hit in Base<i>dr</i>[<i>s,t</i>] in @a output
114 * @param particle Particle to store
115 * @param mother Ultimate mother of particle
116 * @param longest Longest track reference
117 * @param vz Z coordinate of IP
118 * @param nC Total number of track-references in this sector
119 * @param nT Number of distint strips hit in this sector
120 * @param output Output structure
122 Double_t StoreParticle(AliMCParticle* particle,
123 const AliMCParticle* mother,
124 AliTrackReference* ref) const;
125 Double_t fMinR; // Min radius
126 Double_t fMaxR; // Max radius
127 Double_t fMinZ; // Min z
128 Double_t fMaxZ; // Max z
129 AliTrackReference* fStored; //! Last stored
130 TH2D* fOutput; //! Output
132 ClassDef(AliSPDMCTrackDensity,3); // Calculate track-ref density