1 #include "AliHLTFastJetMonitorComponent.h"
2 #include "AliHLTFastJetMonitor.h"
3 #include "AliHLTScalars.h"
8 AliHLTFastJetMonitorComponent::AliHLTFastJetMonitorComponent() :
9 fRootFileName("fjtrigger_histos.root"),
16 // default constructor
19 //____________________________________________________________________________________________________________
21 AliHLTFastJetMonitorComponent::~AliHLTFastJetMonitorComponent()
27 //____________________________________________________________________________________________________________
29 int AliHLTFastJetMonitorComponent::DoInit(int argc, const char **argv)
33 fHistoPtr = new AliHLTFastJetMonitor();
34 for (int i = 0; i < argc; i++) {
35 if (!strcmp("-roothistofilename", argv[i]))
36 fRootFileName = argv[i+1];
37 if (!strcmp("-pushfraction", argv[i]))
38 fPushFraction = atoi(argv[i+1]);
39 if (!strcmp("-verbose", argv[i]))
40 fVerbose = atoi(argv[i+1]);
46 //____________________________________________________________________________________________________________
48 int AliHLTFastJetMonitorComponent::Deinit()
59 //____________________________________________________________________________________________________________
60 const char* AliHLTFastJetMonitorComponent::GetComponentID()
64 return "EmcalFastJetMonitor";
67 //____________________________________________________________________________________________________________
69 void AliHLTFastJetMonitorComponent::GetInputDataTypes(vector<AliHLTComponentDataType> &list)
71 // define input data types
74 list.push_back(kAliHLTDataTypeEventStatistics|kAliHLTDataOriginHLT);
77 //____________________________________________________________________________________________________________
79 AliHLTComponentDataType AliHLTFastJetMonitorComponent::GetOutputDataType()
82 // return output data types
84 return kAliHLTDataTypeHistogram | kAliHLTDataOriginEMCAL;
87 //____________________________________________________________________________________________________________
89 void AliHLTFastJetMonitorComponent::GetOutputDataSize(unsigned long &constBase, double &inputMultiplier)
92 // calculate output data size
95 inputMultiplier = 100;
98 //____________________________________________________________________________________________________________
100 int AliHLTFastJetMonitorComponent::DoEvent(const AliHLTComponentEventData &evtData, const AliHLTComponentBlockData *blocks,
101 AliHLTComponentTriggerData &/*trigData*/, AliHLTUInt8_t */*outputPtr*/, AliHLTUInt32_t &/*size*/,
102 std::vector<AliHLTComponentBlockData> &/*outputBlocks*/)
107 const AliHLTComponentBlockData *iter = NULL;
108 UInt_t specification = 0;
110 for (unsigned long ij = 0; ij < evtData.fBlockCnt; ij++) {
111 AliHLTScalars *scalarPtr = NULL;
113 if (fVerbose) PrintComponentDataTypeInfo(iter->fDataType);
115 if (iter->fDataType == kAliHLTDataTypeEventStatistics) {
116 scalarPtr = reinterpret_cast<AliHLTScalars*>(iter->fPtr);
119 if (fVerbose) HLTWarning("FastJet Monitor: Data block does not contain event stats - check if flag is set for histograming for AliHLTTriggerFastJet \n");
122 specification |= iter->fSpecification;
124 fHistoPtr->MakeHisto(scalarPtr);
129 TFile rootHistFile(fRootFileName, "RECREATE");
131 fHistoPtr->GetHistograms()->Write();
133 if (fLocalEventCount%fPushFraction == 0) {
134 if (fVerbose) cout << "FastJet Monitor: pushback done at " << fLocalEventCount << " evens " << endl;
135 PushBack(fHistoPtr->GetHistograms(), kAliHLTDataTypeTObjArray | kAliHLTDataOriginEMCAL, specification);
140 //____________________________________________________________________________________________________________
142 AliHLTComponent* AliHLTFastJetMonitorComponent::Spawn()
146 return new AliHLTFastJetMonitorComponent();