]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h
Maker scripts now use TrainSetup exclusively.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliSPDMCTrackDensity.h
CommitLineData
f68d9069 1#ifndef ALISPDMCTRACKDENSITY_MC
2#define ALISPDMCTRACKDENSITY_MC
f53fb4f6 3#include "AliBaseMCTrackDensity.h"
f68d9069 4
5/**
6 * A class to calculate the particle density from track references.
7 * This code is used both in AliForwardMCCorrectionsTask and
8 * AliSPDMCDensity calculator.
9 *
10 * @par Input:
11 * - AliMultiplicity object - from reconstruction
12 * - Kinematics
13 * - Track-References
14 *
15 * @par Output:
16 * - AliESDSPD object - content is # of track references/strip
17 *
18 * @par Corrections used:
19 * - None
20 *
21 * @par Histograms:
22 * - Incident angle vs number of track references
23 * - Incident angle vs number of strips/cluster
24 *
bd6f5206 25 * @ingroup pwglf_forward_algo
26 * @ingroup pwglf_forward_mc
27 * @ingroup pwglf_forward_aod
f68d9069 28 */
4bcdcbc1 29class AliSPDMCTrackDensity : public AliBaseMCTrackDensity
f68d9069 30{
31public:
32 /**
33 * Default constructor. Do not use - for ROOT I/O system use only
34 */
35 AliSPDMCTrackDensity();
36 /**
37 * Normal constructor
38 *
39 * @param name Not used
40 */
41 AliSPDMCTrackDensity(const char* name);
42 /**
43 * Copy constructor
44 *
45 * @param o Object to copy from
46 */
47 AliSPDMCTrackDensity(const AliSPDMCTrackDensity& o);
48 /**
49 * Assignment operator
50 *
51 * @param o Object to assign from
52 *
53 * @return Reference to this
54 */
55 AliSPDMCTrackDensity& operator=(const AliSPDMCTrackDensity& o);
56 /**
57 * Destructor.
58 */
59 virtual ~AliSPDMCTrackDensity() {}
60
f68d9069 61 /**
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
71 *
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.
76 *
77 * @return true
78 */
79 Bool_t Calculate(const AliMCEvent& event,
80 Double_t vz,
81 TH2D& output,
82 TH2D* primary);
f68d9069 83 void Print(Option_t* option="") const;
84protected:
85 /**
4bcdcbc1 86 * Must be defined to return the track-reference ID for this detector
f68d9069 87 *
4bcdcbc1 88 * @return Detector id set on track references
89 */
90 Int_t GetDetectorId() const;
f68d9069 91 /**
4bcdcbc1 92 * Process a track reference
f68d9069 93 *
4bcdcbc1 94 * @param particle Particle
95 * @param mother Ultimate mother (if not primary)
96 * @param ref Reference
f68d9069 97 *
4bcdcbc1 98 * @return 0 if no output should be generated for this reference, or
99 * pointer to track-reference to produce output for.
f68d9069 100 */
4bcdcbc1 101 AliTrackReference* ProcessRef(AliMCParticle* particle,
102 const AliMCParticle* mother,
103 AliTrackReference* ref);
f68d9069 104 /**
4bcdcbc1 105 * Called at before loop over track references
f68d9069 106 *
f68d9069 107 */
4bcdcbc1 108 void BeginTrackRefs();
109 Bool_t CheckTrackRef(AliTrackReference* /*ref*/) const;
2b556440 110 /**
4bcdcbc1 111 * Store a particle hit in Base<i>dr</i>[<i>s,t</i>] in @a output
112 *
4bcdcbc1 113 * @param particle Particle to store
114 * @param mother Ultimate mother of particle
290052e7 115 * @param ref Longest track reference
116 *
117 * @return weight
4bcdcbc1 118 */
119 Double_t StoreParticle(AliMCParticle* particle,
120 const AliMCParticle* mother,
121 AliTrackReference* ref) const;
f68d9069 122 Double_t fMinR; // Min radius
123 Double_t fMaxR; // Max radius
124 Double_t fMinZ; // Min z
125 Double_t fMaxZ; // Max z
4bcdcbc1 126 AliTrackReference* fStored; //! Last stored
127 TH2D* fOutput; //! Output
f68d9069 128
4bcdcbc1 129 ClassDef(AliSPDMCTrackDensity,3); // Calculate track-ref density
f68d9069 130};
131
132#endif
133// Local Variables:
134// mode: C++
135// End: