ROOT logo
// 
// This class inspects the event 
//
#ifndef ALIFMDMCEVENTINSPECTOR_H
#define ALIFMDMCEVENTINSPECTOR_H
/**
 * @file   AliFMDMCEventInspector.h
 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
 * @date   Wed Mar 23 14:03:40 2011
 * 
 * @brief  
 * 
 * 
 * @ingroup pwglf_forward_aod
 */
#include "AliFMDEventInspector.h"
class AliMCEvent;
class TH2F;
class AliStack;

/** 
 * This class inspects the event 
 *
 * @par Input:
 *   - AliESDFMD object possibly corrected for sharing
 *
 * @par Output:
 *   - A histogram of v_z of events with triggers. 
 *   - A histogram of v_z of events with vertex and triggers 
 *   - A histogram of trigger counters 
 * 
 * Note, that these are added to the master output list 
 *
 * @par Corrections used: 
 *   - None
 *
 * @ingroup pwglf_forward_algo 
 * @ingroup pwglf_forward_mc
 * @ingroup pwglf_forward_aod
 */
class AliFMDMCEventInspector : public AliFMDEventInspector
{
public:
  /** 
   * Constructor 
   */
  AliFMDMCEventInspector();
  /** 
   * Constructor 
   * 
   * @param name Name of object
   */
  AliFMDMCEventInspector(const char* name);
  /** 
   * Copy constructor 
   * 
   * @param o Object to copy from 
   */
  AliFMDMCEventInspector(const AliFMDMCEventInspector& o);
  /** 
   * Destructor 
   */
  virtual ~AliFMDMCEventInspector();
  /** 
   * Assignement operator
   * 
   * @param o Object to assign from 
   * 
   * @return Reference to this object
   */
  AliFMDMCEventInspector& operator=(const AliFMDMCEventInspector&);

  /** 
   * Initialize the object 
   * 
   * @param vtxAxis Vertex axis in use 
   */
  void SetupForData(const TAxis& vtxAxis);
  /** 
   * Process MC truth event.  Note, returned values are the MC truth
   * values
   * 
   * @param event     Input event 
   * @param triggers  On return, the triggers fired 
   * @param ivz       On return, the found vertex bin (1-based).  A zero
   *                  means outside of the defined vertex range
   * @param vz        On return, the z position of the interaction
   * @param b         On return, impact parameter [fm] (if available)
   * @param c         On return, centrality estimate [%] (if available)
   * @param npart     On return, number of participants (if available)
   * @param nbin      On return, number of binary collisions (if available)
   * @param phiR      On return, reaction plane angle (if available)
   * 
   * @return 0 (or kOk) on success, otherwise a bit mask of error codes 
   */
  UInt_t ProcessMC(AliMCEvent*       event, 
		   UInt_t&           triggers,
		   UShort_t&         ivz, 
		   Double_t&         vz,
		   Double_t&         b,
		   Double_t&         c,
		   Int_t&            npart, 
		   Int_t&            nbin,
		   Double_t&         phiR);
  /** 
   * Compare the result of analysing the ESD for 
   * the inclusive charged particle density to analysing 
   * MC truth 
   * 
   * @param vz       Found @f$ v_z@f$
   * @param trueVz   True  @f$ v_z@f$
   * @param cent     Centrality
   * @param mcC      Centrality from Impact par. 
   * @param b        Impact parameter (if available)
   * @param npart    Number of participants (if available)
   * @param nbin     Number of binary collisions (if available)
   * 
   * @return true
   */
  virtual Bool_t CompareResults(Double_t vz,    Double_t trueVz, 
				Double_t cent,  Double_t mcC,
				Double_t b,
				Int_t    npart, Int_t    nbin);
  /** 
   * Read the production details 
   * 
   * @param event MC event
   */
  virtual void ReadProductionDetails(AliMCEvent* event);
protected:
  /** 
   * Read centrality from event 
   * 
   * @param esd  Event 
   * @param cent On return, the centrality or negative if not found
   * @param qual On return, centrality quality flag
   * 
   * @return False on error, true otherwise 
   */
  virtual Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
				UShort_t& qual) const;
  /** 
   * Check if the event is single diffractive 
   * 
   * @param stack  Stack of MC particles 
   * @param xiMin  Lower cut off
   * @param xiMax  Upper cut off 
   * 
   * @return 
   */
  Bool_t IsSingleDiffractive(AliStack* stack,
			     Double_t xiMin=0, 
			     Double_t xiMax=1./81) const;
  virtual Bool_t CheckFastPartition(bool) const { return false; }

  TH1F* fHVertex;  // Histogram of vertex 
  TH1F* fHPhiR;    // Histogram of event plane 
  TH1F* fHB;       // Histogram of impact parameter 
  TH1F* fHMcC;     // Histogram of centrality derived from imp. par.
  TH2F* fHBvsPart; // Impact parameter vs # participants 
  TH2F* fHBvsBin;  // Impact parameter vs # participants 
  TH2F* fHBvsCent; // Impact parameter vs centrality
  TH2F* fHVzComp;  // True vs reconstructed vz
  TH2F* fHCentVsPart; // Centrality versus # participants 
  TH2F* fHCentVsBin;  // Centrality versus # binary collisions 
  TH2F* fHCentVsMcC;  // Compare centralities
  TString fProduction; // Production information 
  ClassDef(AliFMDMCEventInspector,4); // Inspect the event 
};

#endif
// Local Variables:
//   mode: C++
// End:



 AliFMDMCEventInspector.h:1
 AliFMDMCEventInspector.h:2
 AliFMDMCEventInspector.h:3
 AliFMDMCEventInspector.h:4
 AliFMDMCEventInspector.h:5
 AliFMDMCEventInspector.h:6
 AliFMDMCEventInspector.h:7
 AliFMDMCEventInspector.h:8
 AliFMDMCEventInspector.h:9
 AliFMDMCEventInspector.h:10
 AliFMDMCEventInspector.h:11
 AliFMDMCEventInspector.h:12
 AliFMDMCEventInspector.h:13
 AliFMDMCEventInspector.h:14
 AliFMDMCEventInspector.h:15
 AliFMDMCEventInspector.h:16
 AliFMDMCEventInspector.h:17
 AliFMDMCEventInspector.h:18
 AliFMDMCEventInspector.h:19
 AliFMDMCEventInspector.h:20
 AliFMDMCEventInspector.h:21
 AliFMDMCEventInspector.h:22
 AliFMDMCEventInspector.h:23
 AliFMDMCEventInspector.h:24
 AliFMDMCEventInspector.h:25
 AliFMDMCEventInspector.h:26
 AliFMDMCEventInspector.h:27
 AliFMDMCEventInspector.h:28
 AliFMDMCEventInspector.h:29
 AliFMDMCEventInspector.h:30
 AliFMDMCEventInspector.h:31
 AliFMDMCEventInspector.h:32
 AliFMDMCEventInspector.h:33
 AliFMDMCEventInspector.h:34
 AliFMDMCEventInspector.h:35
 AliFMDMCEventInspector.h:36
 AliFMDMCEventInspector.h:37
 AliFMDMCEventInspector.h:38
 AliFMDMCEventInspector.h:39
 AliFMDMCEventInspector.h:40
 AliFMDMCEventInspector.h:41
 AliFMDMCEventInspector.h:42
 AliFMDMCEventInspector.h:43
 AliFMDMCEventInspector.h:44
 AliFMDMCEventInspector.h:45
 AliFMDMCEventInspector.h:46
 AliFMDMCEventInspector.h:47
 AliFMDMCEventInspector.h:48
 AliFMDMCEventInspector.h:49
 AliFMDMCEventInspector.h:50
 AliFMDMCEventInspector.h:51
 AliFMDMCEventInspector.h:52
 AliFMDMCEventInspector.h:53
 AliFMDMCEventInspector.h:54
 AliFMDMCEventInspector.h:55
 AliFMDMCEventInspector.h:56
 AliFMDMCEventInspector.h:57
 AliFMDMCEventInspector.h:58
 AliFMDMCEventInspector.h:59
 AliFMDMCEventInspector.h:60
 AliFMDMCEventInspector.h:61
 AliFMDMCEventInspector.h:62
 AliFMDMCEventInspector.h:63
 AliFMDMCEventInspector.h:64
 AliFMDMCEventInspector.h:65
 AliFMDMCEventInspector.h:66
 AliFMDMCEventInspector.h:67
 AliFMDMCEventInspector.h:68
 AliFMDMCEventInspector.h:69
 AliFMDMCEventInspector.h:70
 AliFMDMCEventInspector.h:71
 AliFMDMCEventInspector.h:72
 AliFMDMCEventInspector.h:73
 AliFMDMCEventInspector.h:74
 AliFMDMCEventInspector.h:75
 AliFMDMCEventInspector.h:76
 AliFMDMCEventInspector.h:77
 AliFMDMCEventInspector.h:78
 AliFMDMCEventInspector.h:79
 AliFMDMCEventInspector.h:80
 AliFMDMCEventInspector.h:81
 AliFMDMCEventInspector.h:82
 AliFMDMCEventInspector.h:83
 AliFMDMCEventInspector.h:84
 AliFMDMCEventInspector.h:85
 AliFMDMCEventInspector.h:86
 AliFMDMCEventInspector.h:87
 AliFMDMCEventInspector.h:88
 AliFMDMCEventInspector.h:89
 AliFMDMCEventInspector.h:90
 AliFMDMCEventInspector.h:91
 AliFMDMCEventInspector.h:92
 AliFMDMCEventInspector.h:93
 AliFMDMCEventInspector.h:94
 AliFMDMCEventInspector.h:95
 AliFMDMCEventInspector.h:96
 AliFMDMCEventInspector.h:97
 AliFMDMCEventInspector.h:98
 AliFMDMCEventInspector.h:99
 AliFMDMCEventInspector.h:100
 AliFMDMCEventInspector.h:101
 AliFMDMCEventInspector.h:102
 AliFMDMCEventInspector.h:103
 AliFMDMCEventInspector.h:104
 AliFMDMCEventInspector.h:105
 AliFMDMCEventInspector.h:106
 AliFMDMCEventInspector.h:107
 AliFMDMCEventInspector.h:108
 AliFMDMCEventInspector.h:109
 AliFMDMCEventInspector.h:110
 AliFMDMCEventInspector.h:111
 AliFMDMCEventInspector.h:112
 AliFMDMCEventInspector.h:113
 AliFMDMCEventInspector.h:114
 AliFMDMCEventInspector.h:115
 AliFMDMCEventInspector.h:116
 AliFMDMCEventInspector.h:117
 AliFMDMCEventInspector.h:118
 AliFMDMCEventInspector.h:119
 AliFMDMCEventInspector.h:120
 AliFMDMCEventInspector.h:121
 AliFMDMCEventInspector.h:122
 AliFMDMCEventInspector.h:123
 AliFMDMCEventInspector.h:124
 AliFMDMCEventInspector.h:125
 AliFMDMCEventInspector.h:126
 AliFMDMCEventInspector.h:127
 AliFMDMCEventInspector.h:128
 AliFMDMCEventInspector.h:129
 AliFMDMCEventInspector.h:130
 AliFMDMCEventInspector.h:131
 AliFMDMCEventInspector.h:132
 AliFMDMCEventInspector.h:133
 AliFMDMCEventInspector.h:134
 AliFMDMCEventInspector.h:135
 AliFMDMCEventInspector.h:136
 AliFMDMCEventInspector.h:137
 AliFMDMCEventInspector.h:138
 AliFMDMCEventInspector.h:139
 AliFMDMCEventInspector.h:140
 AliFMDMCEventInspector.h:141
 AliFMDMCEventInspector.h:142
 AliFMDMCEventInspector.h:143
 AliFMDMCEventInspector.h:144
 AliFMDMCEventInspector.h:145
 AliFMDMCEventInspector.h:146
 AliFMDMCEventInspector.h:147
 AliFMDMCEventInspector.h:148
 AliFMDMCEventInspector.h:149
 AliFMDMCEventInspector.h:150
 AliFMDMCEventInspector.h:151
 AliFMDMCEventInspector.h:152
 AliFMDMCEventInspector.h:153
 AliFMDMCEventInspector.h:154
 AliFMDMCEventInspector.h:155
 AliFMDMCEventInspector.h:156
 AliFMDMCEventInspector.h:157
 AliFMDMCEventInspector.h:158
 AliFMDMCEventInspector.h:159
 AliFMDMCEventInspector.h:160
 AliFMDMCEventInspector.h:161
 AliFMDMCEventInspector.h:162
 AliFMDMCEventInspector.h:163
 AliFMDMCEventInspector.h:164
 AliFMDMCEventInspector.h:165
 AliFMDMCEventInspector.h:166
 AliFMDMCEventInspector.h:167
 AliFMDMCEventInspector.h:168
 AliFMDMCEventInspector.h:169
 AliFMDMCEventInspector.h:170
 AliFMDMCEventInspector.h:171
 AliFMDMCEventInspector.h:172
 AliFMDMCEventInspector.h:173
 AliFMDMCEventInspector.h:174
 AliFMDMCEventInspector.h:175
 AliFMDMCEventInspector.h:176
 AliFMDMCEventInspector.h:177