StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdEvtFilterApplyMaker.cxx
1 /*
2  * StMtdEvtFilterApplyMaker
3  *
4  * Skip production of events using MTD criteria stored in tags.root
5  * under the MtdTrackFilterTag structure, which is filled in the
6  * StMtdEvtFilterMaker class
7  *
8  */
9 
10 #include "StMessMgr.h"
11 #include "StMtdEvtFilterApplyMaker.h"
12 #include <bitset>
13 
15 
16 //____________________________________________________________________________________________________
18 {
19  // Colon-separated list of variables (formulas, as can be used in TTree::Draw() method)
20  // to use in the determination of skipping events.
21  // Individual variable values will be available as GetVal(0),GetVal(1),GetVal(2) ...
22  // Individual variable names will be available as GetVar(0),GetVar(1),GetVar(2) ...
23 
24  // StMtdEvtFilterApplyMaker uses tags stored under the MtdTrackFilterTag structure,
25  // which is filled in the StMtdEvtFilterMaker class
26 
27  SetVarList("MtdTrackFilterTag.isRejectEvent:MtdTrackFilterTag.shouldHaveRejectEvent:MtdTrackFilterTag.tpcSectors");
28 }
29 
30 //____________________________________________________________________________________________________
32 {
33  LOG_INFO << "Found isReject = " << GetVal(0)
34  << " and shouldHaveReject = " << GetVal(1)
35  << " and tpcSectors = " << (bitset<24>)(GetVal(2)) << endm;
36 
38  if (GetVal(0) != 0) return true; // true means skip
39 
45  TDataSet* ds1 = new TDataSet("MtdShouldHaveRejectEvent");
46  TDataSet* ds2 = new TDataSet("TpcSectorsByMtd");
47  ds1->SetTitle(Form("%d",(int) GetVal(1)));
48  ds2->SetTitle(Form("%u",(unsigned int) GetVal(2)));
49  AddData(ds1);
50  AddData(ds2);
51 
52  return false; // false means accept
53 }
54 
55 /* -------------------------------------------------------------------------
56  * $Id: StMtdEvtFilterApplyMaker.cxx,v 1.1 2015/05/01 21:25:57 jeromel Exp $
57  * $Log: StMtdEvtFilterApplyMaker.cxx,v $
58  * Revision 1.1 2015/05/01 21:25:57 jeromel
59  * First version of the DataFiler + one imp: MTD. Code from GVB reviewed & closed (VP+JL))
60  *
61  *
62  * -------------------------------------------------------------------------
63  */
64 
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
Definition: StMaker.cxx:332
Skip events using criteria in .pretags.root.
Double_t GetVal(int i, int idx=0)
Skip events using MTD criteria.