17 |
|
#include "MitAna/TAM/interface/TAModule.h" |
18 |
|
#include "MitAna/TreeMod/interface/Selector.h" |
19 |
|
#include "MitAna/TreeMod/interface/TreeLoader.h" |
20 |
+ |
#include "MitAna/TreeMod/interface/HLTFwkMod.h" |
21 |
+ |
#include "MitAna/Catalog/interface/Dataset.h" |
22 |
|
|
23 |
|
ClassImp(mithep::Analysis) |
24 |
|
|
27 |
|
//-------------------------------------------------------------------------------------------------- |
28 |
|
Analysis::Analysis(Bool_t useproof) : |
29 |
|
fUseProof(useproof), |
30 |
< |
fHierachy(kTRUE), |
30 |
> |
fUseHLT(kTRUE), |
31 |
> |
fHierarchy(kTRUE), |
32 |
> |
fDoProxy(kTRUE), |
33 |
|
fState(kPristine), |
34 |
|
fNFriends(0), |
35 |
|
fList(new TList), |
197 |
|
} |
198 |
|
|
199 |
|
//-------------------------------------------------------------------------------------------------- |
200 |
+ |
Bool_t Analysis::AddDataset(const Dataset *dataset) |
201 |
+ |
{ |
202 |
+ |
// Add a full dataset to the analysis. |
203 |
+ |
|
204 |
+ |
Bool_t status = true; |
205 |
+ |
|
206 |
+ |
for (UInt_t i=0; i<dataset->NFiles(); i++) |
207 |
+ |
status = (status && AddFile(dataset->FileUrl(i))); |
208 |
+ |
|
209 |
+ |
return status; |
210 |
+ |
} |
211 |
+ |
|
212 |
+ |
//-------------------------------------------------------------------------------------------------- |
213 |
|
void Analysis::AddList(TList *list, Int_t eventlist) |
214 |
|
{ |
215 |
|
// Add file name to the event list specified by eventlist. The lists are used to hold filenames of |
330 |
|
fLoaders->Add(bl); |
331 |
|
fDeleteList->Add(bl); |
332 |
|
|
333 |
+ |
// create our HLT framework module |
334 |
+ |
HLTFwkMod *hltmod = 0; |
335 |
+ |
if (fUseHLT) { |
336 |
+ |
hltmod = new HLTFwkMod; |
337 |
+ |
fDeleteList->Add(hltmod); |
338 |
+ |
} |
339 |
+ |
|
340 |
|
if (fUseProof) { |
341 |
|
|
342 |
+ |
if (hltmod) |
343 |
+ |
fProof->AddInput(hltmod); |
344 |
+ |
|
345 |
|
fProof->AddInput(fSuperMod); |
346 |
|
fLoaders->SetName("TAM_LOADERS"); |
347 |
|
fProof->AddInput(fLoaders); |
350 |
|
|
351 |
|
// when not running Proof, we must make a selector |
352 |
|
fSelector = new Selector; |
353 |
+ |
fSelector->SetDoProxy(fDoProxy); |
354 |
+ |
if (hltmod) |
355 |
+ |
fSelector->AddInput(hltmod); |
356 |
|
fSelector->AddInput(fSuperMod); |
357 |
|
MDB(kAnalysis, 2) |
358 |
|
fSelector->SetVerbosity(1); |
496 |
|
MDB(kAnalysis, 1) |
497 |
|
Info("Terminate", "Saving output to %s!", fAnaOutput.Data()); |
498 |
|
|
499 |
< |
if (fHierachy) |
499 |
> |
if (fHierarchy) |
500 |
|
fOutput->Write(fOutput->GetName(),TObject::kSingleKey); |
501 |
|
else |
502 |
|
fOutput->Write(); |
503 |
|
|
504 |
|
} |
505 |
|
} |
506 |
+ |
// set state to terminate |
507 |
+ |
fState = kTerminate; |
508 |
|
} |
509 |
|
|
510 |
|
delete fChain; |
511 |
|
delete fSet; |
512 |
|
fDeleteList->Delete(); |
481 |
– |
|
482 |
– |
fState = kTerminate; |
513 |
|
} |
514 |
|
|
515 |
|
//-------------------------------------------------------------------------------------------------- |