StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrigOnlyPanitkinMaker.cxx
1 // *-- Author :Jan Balewski
2 //
3 // $Id: StTrigOnlyPanitkinMaker.cxx,v 1.4 2009/01/23 00:14:51 ogrebeny Exp $
4 
5 #include <TFile.h>
6 #include <TH1.h>
7 #include <TH2.h>
8 #include <StMessMgr.h>
9 
10 #include "StTrigOnlyPanitkinMaker.h"
11 #include "StEEmcPool/HanksTriggerDataReader/StTriggerDataReader.h"
12 #include "StTriggerData2005.h"
13 #include "EEdsmAna.h"
14 
15 
17 
18 //________________________________________________
19 //________________________________________________
20 StTrigOnlyPanitkinMaker::StTrigOnlyPanitkinMaker( const char* self ,const char* muDstMakerName) : StMaker(self){
21  nTrigEve=nInpEve=0;
22  HList=0;
23 }
24 
25 
26 //___________________ _____________________________
27 //________________________________________________
28 StTrigOnlyPanitkinMaker::~StTrigOnlyPanitkinMaker(){
29  delete dsm;
30 }
31 
32 //___________________ _____________________________
33 //________________________________________________
34 void StTrigOnlyPanitkinMaker::saveHisto(TString fname){
35  TString outName=fname+".hist.root";
36  TFile f( outName,"recreate");
37  assert(f.IsOpen());
38  printf("%d histos are written to '%s' ...\n",HList->GetEntries(),outName.Data());
39  HList->Write();
40  f.Close();
41 
42 }
43 
44 //________________________________________________
45 //________________________________________________
46 Int_t StTrigOnlyPanitkinMaker::Init(){
47 
48  assert(HList);
49  dsm= 0; //new EEdsmAna(HList,"allTrig");
50  if (dsm) dsm->initHisto();
51  return StMaker::Init();
52 }
53 
54 
55 //________________________________________________
56 //________________________________________________
58  gMessMgr->Message("","I") <<GetName()<<"::Finish() inputEve="<<nInpEve<<" trigFilterEve="<<nTrigEve<<endm;
59  return kStOK;
60 }
61 
62 //________________________________________________
63 //________________________________________________
64 void StTrigOnlyPanitkinMaker::Clear(const Option_t*){
65  if (dsm) dsm->clear();
66 }
67 
68 
69 //________________________________________________
70 //________________________________________________
72  nInpEve++;
73  gMessMgr->Message("","D") <<GetName()<<"::Make() is called "<<endm;
74 
75  StTriggerDataReader* trgreader = (StTriggerDataReader*)GetMaker("TRGRD");
76  assert(trgreader);
77  void *blob=trgreader->GetTriggerData();
78 
79  int runNo=-999;
80  assert(runNo>0); //JB: I broke it, needs run# to be provided from somewhere???
81 
82  StTriggerData2005 trgAkio5( (const TrgDataType2005 *)blob,runNo);
83 
84  //........ filter trigger -none
85  nTrigEve++;
86 
87  const unsigned char * dsm0inp= trgAkio5.getDsm0_EEMC();
88  unsigned short int * dsm1inp= trgAkio5.getDsm1_EEMC();
89  unsigned short int * dsm2inp= trgAkio5.getDsm2_EMC();
90  unsigned short int * dsm3inp= trgAkio5.getDsm3();
91  // trgAkio5->dump();
92  if (dsm) dsm->sort( dsm0inp, dsm1inp, dsm2inp, dsm3inp);
93 
94  return kStOK;
95 }
96 
97 //---------------------------------------------------
98 // $Log: StTrigOnlyPanitkinMaker.cxx,v $
99 // Revision 1.4 2009/01/23 00:14:51 ogrebeny
100 // Inherited EEmcDb from StEEmcDbMaker to fix run-time bug http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1378
101 //
102 // Revision 1.3 2008/12/19 17:54:35 fine
103 // Disable the dummy class
104 //
105 // Revision 1.2 2006/09/15 01:45:36 balewski
106 // add run# to trg-data unpaker
107 //
108 // Revision 1.1 2005/06/17 17:41:13 balewski
109 // *** empty log message ***
110 //
111 //
112 
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
Definition: Stypes.h:40