StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtQaMaker.cxx
1 
6 /***************************************************************************
7  *
8  * $Id: StFgtQaMaker.cxx,v 1.1 2012/01/31 09:26:17 sgliske Exp $
9  * Author: S. Gliske, Sept 2011
10  *
11  ***************************************************************************
12  *
13  * Description: See header.
14  *
15  ***************************************************************************
16  *
17  * $Log: StFgtQaMaker.cxx,v $
18  * Revision 1.1 2012/01/31 09:26:17 sgliske
19  * StFgtQaMakers moved to StFgtPool
20  *
21  * Revision 1.4 2012/01/26 13:13:11 sgliske
22  * Updated to use StFgtConsts, which
23  * replaces StFgtEnums and StFgtGeomDefs
24  *
25  * Revision 1.3 2011/11/01 19:07:24 sgliske
26  * Updated to correspond with StEvent containers, take 2.
27  *
28  * Revision 1.2 2011/09/28 17:48:50 sgliske
29  * minor updates
30  *
31  * Revision 1.1 2011/09/27 15:28:17 sgliske
32  * added common StFgtQaMaker parent
33  *
34  *
35  **************************************************************************/
36 
37 #include "StFgtQaMaker.h"
38 
39 #include <string>
40 #include <TROOT.h>
41 #include <TStyle.h>
42 #include <TCanvas.h>
43 #include "StMaker.h"
44 
45 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
46 
47 #include "StRoot/StEvent/StEvent.h"
48 #include "StRoot/StEvent/StFgtCollection.h"
49 
50 // constructors
51 StFgtQaMaker::StFgtQaMaker( const Char_t* name,
52  Short_t discId,
53  Short_t quadId,
54  const Char_t* quadName ) :
55  StMaker( name ), mFgtCollectionPtr(0), mDiscId( discId ), mQuadId( quadId ), mTimeBin( 4 ),
56  mDoVsStrip( 'c' ), mDoSubtrPeds( 0 ),
57  mXbins( 1280 ), mYbins( 4096 ), mXmin( 0 ), mXmax( 1280 ), mYmin( 0 ), mYmax( mYbins ),
58  mBinFactorX( 1 ), mBinFactorY( 1 ), mQuadName( quadName ), mPedReader(0), mPedThres(-1e100) {
59  // set the style to plain
60  gROOT->SetStyle("Plain");
61 };
62 
63 StFgtQaMaker::StFgtQaMaker(const StFgtQaMaker&){
64  std::cerr << "TODO" << endl;
65  throw 0;
66 };
67 
68 // deconstructor
69 StFgtQaMaker::~StFgtQaMaker(){
70  if( mPedReader )
71  delete mPedReader;
72 };
73 
74 // equals operator
75 StFgtQaMaker& StFgtQaMaker::operator=(const StFgtQaMaker&){
76  std::cerr << "TODO" << endl;
77  throw 0;
78 };
79 
80 Int_t StFgtQaMaker::Init(){
81  Int_t ierr = kStOk;
82 
83  if( mDoSubtrPeds && mPedFile.empty() ){
84  std::cout << "Cannot subtract peds--database not yet implemented" << endl;
85  ierr = kStFatal;
86  };
87 
88  // now the ped reader, if needed
89  if( !ierr && mDoSubtrPeds ){
90  //std::cout << "Constructing ped reader" << std::endl;
91  mPedReader = new StFgtPedReader( mPedFile.data() );
92  ierr = mPedReader->Init();
93  };
94 
95  return ierr;
96 };
97 
99  Int_t ierr = kStOk;
100 
101  StEvent* eventPtr = 0;
102  eventPtr = (StEvent*)GetInputDS("StEvent");
103 
104  if( !eventPtr ) {
105  LOG_ERROR << "Error getting pointer to StEvent from '" << ClassName() << "'" << endm;
106  ierr = kStErr;
107  };
108 
109  mFgtCollectionPtr = 0;
110 
111  if( eventPtr ) {
112  mFgtCollectionPtr=eventPtr->fgtCollection();
113  };
114 
115  if( !mFgtCollectionPtr) {
116  LOG_ERROR << "Error getting pointer to StFgtCollection from '" << ClassName() << "'" << endm;
117  ierr = kStErr;
118  };
119 
120  return ierr;
121 };
122 
123 ClassImp(StFgtQaMaker);
virtual Int_t Make()
Definition: Stypes.h:44
Definition: Stypes.h:41