]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
Various updates
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliForwardMultiplicityBase.cxx
1 //====================================================================
2 // 
3 // Base class for classes that calculate the multiplicity in the
4 // forward regions event-by-event
5 // 
6 // Inputs: 
7 //   - AliESDEvent 
8 //
9 // Outputs: 
10 //   - AliAODForwardMult 
11 // 
12 // Histograms 
13 //   
14 // Corrections used 
15 #include "AliForwardMultiplicityBase.h"
16 #include "AliForwardCorrectionManager.h"
17 #include "AliLog.h"
18 #include "AliAODHandler.h"
19 #include "AliInputEventHandler.h"
20 #include "AliAnalysisManager.h"
21 #include "AliFMDEventInspector.h"
22 #include "AliFMDEnergyFitter.h"
23 #include "AliFMDSharingFilter.h"
24 #include "AliFMDDensityCalculator.h"
25 #include "AliFMDCorrections.h"
26 #include "AliFMDHistCollector.h"
27 #include <TROOT.h>
28 #include <iostream>
29 #include <iomanip>
30
31 //====================================================================
32 Bool_t 
33 AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const
34 {
35   // 
36   // Check if all needed corrections are there and accounted for.  If not,
37   // do a Fatal exit 
38   // 
39   // Parameters:
40   //    what Which corrections is needed
41   // 
42   // Return:
43   //    true if all present, false otherwise
44   //  
45
46   AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
47   // Check that we have the energy loss fits, needed by 
48   //   AliFMDSharingFilter 
49   //   AliFMDDensityCalculator 
50   if (what & AliForwardCorrectionManager::kELossFits && !fcm.GetELossFit()) { 
51     AliFatal(Form("No energy loss fits"));
52     return false;
53   }
54   // Check that we have the double hit correction - (optionally) used by 
55   //  AliFMDDensityCalculator 
56   if (what & AliForwardCorrectionManager::kDoubleHit && !fcm.GetDoubleHit()) {
57     AliFatal("No double hit corrections"); 
58     return false;
59   }
60   // Check that we have the secondary maps, needed by 
61   //   AliFMDCorrections 
62   //   AliFMDHistCollector
63   if (what & AliForwardCorrectionManager::kSecondaryMap && 
64       !fcm.GetSecondaryMap()) {
65     AliFatal("No secondary corrections");
66     return false;
67   }
68   // Check that we have the vertex bias correction, needed by 
69   //   AliFMDCorrections 
70   if (what & AliForwardCorrectionManager::kVertexBias && 
71       !fcm.GetVertexBias()) { 
72     AliFatal("No event vertex bias corrections");
73     return false;
74   }
75   // Check that we have the merging efficiencies, optionally used by 
76   //   AliFMDCorrections 
77   if (what & AliForwardCorrectionManager::kMergingEfficiency && 
78       !fcm.GetMergingEfficiency()) {
79     AliFatal("No merging efficiencies");
80     return false;
81   }
82   return true;
83 }
84
85 //____________________________________________________________________
86 void
87 AliForwardMultiplicityBase::MarkEventForStore() const
88 {
89   // Make sure the AOD tree is filled 
90   AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
91   AliAODHandler*      ah = 
92     dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler());
93   if (!ah)  
94     AliFatal("No AOD output handler set in analysis manager");
95
96   ah->SetFillAOD(kTRUE);
97 }
98
99 //____________________________________________________________________
100 void
101 AliForwardMultiplicityBase::Print(Option_t* option) const
102 {
103   // 
104   // Print information 
105   // 
106   // Parameters:
107   //    option Not used
108   //
109   std::cout << "AliForwardMultiplicityBase: " << GetName() << "\n" 
110             << "  Enable low flux code:   " << (fEnableLowFlux ? "yes" : "no")
111             << std::endl;
112   gROOT->IncreaseDirLevel();
113   GetEventInspector()   .Print(option);
114   GetEnergyFitter()     .Print(option);    
115   GetSharingFilter()    .Print(option);
116   GetDensityCalculator().Print(option);
117   GetCorrections()      .Print(option);
118   GetHistCollector()    .Print(option);
119   gROOT->DecreaseDirLevel();
120 }
121
122
123 //
124 // EOF
125 //