StRoot  1
L2jetAlgo2009.h
1 #ifndef L2JETALGO2D_H
2 #define L2JETALGO2D_H
3 /***********************************************************
4  * \$Id: L2jetAlgo2009.h,v 1.1 2010/04/17 05:04:13 pibero Exp \$
5  * \author Jan Balewski, IUCF, 2008
6  ***********************************************************
7  * Descripion:
8  * Reco of mono- & di-jets in L2 using BTOW+ETOW
9  ***********************************************************
10  * version updated 2/17/2008 W.W. Jacobs
11  * 2008 to 2009 change by B.S. Page 11/12/2008
12 */
13
14 #ifdef IS_REAL_L2 //in l2-ana environmen
15  #include "L2VirtualAlgo2009.h"
16 #else
17  #include "L2algoUtil/L2VirtualAlgo2009.h"
18  #include "L2algoUtil/L2EmcGeom.h"
19 #endif
20
21 class L2Histo;
22 class L2Jet;
23
24
26  public:
27  enum {MaxBtowRdo=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; // shortcut
28  enum {MaxEtowRdo=(EtowGeom::mxEtaBin) * (EtowGeom::mxPhiBin)}; // shortcut
29  enum {cl2jetMaxEtaBins=15, cl2jetMaxPhiBins=30};
30
31  /* enum below defines L2 jet 0.6x0.6 size
32  WARN: do NOT change it w/o understaning of
33  ScanEta/phi-algos algo,JB */
34  //enum {cl2jet_par_mxPhiBin=3, cl2jet_par_mxEtaBin=3}; //For .6x.6 JP
35  enum {cl2jet_par_mxPhiBin=5, cl2jet_par_mxEtaBin=5}; //For 1x1 JP BP
36  private:
37
38  //..................... params set in initRun
39  int par_useBtowEast;
40  int par_useBtowWest;
41  int par_useEndcap;
42  int par_minPhiBinDiff;
43
44  float par_diJetThrHigh;
45  float par_diJetThrLow;
46  float par_diJetThr_2; // added for xtra E_T cuts -- wwj 2/10
47  float par_diJetThr_3; // added for xtra E_T cuts -- wwj 2/10
48  float par_diJetThr_4; // added for xtra E_T cuts -- wwj 2/10
49  float par_diJetThr_5; // added for xtra E_T cuts -- wwj 2/10
50  float par_oneJetThr;
51  float par_diJetEtaLow; // added for xtra Eta cuts -- wwj 2/10
52  float par_diJetEtaHigh; // added for xtra Eta cuts -- wwj 2/10
53  int par_dbg;
54  int *raw_ints;
55  float *raw_floats;
56
57  float par_hotTwEtThr;
58
59  //.............run-long variables
60  enum { mxHA=256, mxJ=2}; // change to 256 (need ~ 134) -- wwj 2/10
61  L2Histo *hA[mxHA]; // my private HBOOK@L2
62  long run_startUnix;
63  int run_number;
64  char namechar; //single character name to differentiate low and high jet. printed to 'dumm' in L2jetResults.
65
66  // event counters
67  int run_nEventOneJet, run_nEventDiJet, run_nEventRnd;
68
69  /* fast DB lookup tables */
70  unsigned short db_btowL2PhiBin[MaxBtowRdo];
71  unsigned short db_btowL2PatchBin[MaxBtowRdo];
72
73  // similar tables for ETOW ....
74  unsigned short db_etowL2PhiBin[MaxEtowRdo];
75  unsigned short db_etowL2PatchBin[MaxEtowRdo];
76
77  class L2Jet {
78  public:
79  /* Note, some variables below are NOT in physical units,
80  this is tricky, be careful
81  */
82  int iphiBin; // phi-bin location of _left_edge_
83  float fphiBin; // phi-bin location of _centroid_
84  int ietaBin; // eta-bin location of _left_edge_
85  float fetaBin; // eta-bin location of _centroid_
86  float iene; // int4 transverse energy
88  float eneGeV; // energy in GeV
89  float rmsEtaBin; // put in to carry rms calc out of functions
90  float rmsPhiBin; // rms of jet in units of phi bins (15 bins=3 eta units)
91
92  L2Jet(){}; // compact jet holder
93  void clear(){
94  iphiBin=ietaBin=0;
96  }
97  };
98
99  //............... event-long variables
100  int eve_ID;
101  float eve_patchEne[cl2jetMaxEtaBins*cl2jetMaxPhiBins];//450 was int
102  float eve_phiEne[cl2jetMaxPhiBins+cl2jet_par_mxPhiBin-1];//was int
103  L2Jet * eve_Jet[mxJ];
104
105  // utility methods
106  void createHisto();
107  void clearEvent();
108  int projectAdc(const HitTower1 *hit, const int hitSize,
109  unsigned short *phiBin, unsigned short *patchBin,
110  L2Histo *hHot );
111  float scanPhi();
112  void scanEta(int iJ);//int iphi0, int *etaEneA, float *fetaBinMax, int *eneMax ,int *ietaBinLeft);
113  float true2Dscan();
114  void weightedEtaPhi(int iK);
115  void weightedPhi(int iJ);
116  void dumpPatchEneA();
117  void finishRunHisto();
118  bool paramsChanged( int *rc_ints, float *rc_floats);
119  void computeE(int token);
120  //bool decisionUser(int token, int *myL2Result);//BP
121  //void computeUser(int token);//BP these may have to be public?
122
123  public:
124  L2jetAlgo2009(const char* name, L2EmcDb* db, char* outDir, int resOff, bool writeHighResult=false);
125  // ~L2jetAlgo2008(){}; // memory leak NOT taken care of
126  int initRunUser( int runNo, int *rc_ints, float *rc_floats);
127  bool decisionUser(int token, int *myL2Result);//BP
128  void computeUser(int token);//BP these may have to be public?
129  void finishRunUser();// at the end of each run
130 };
131
132 #endif
133
134 /**********************************************************************
135  \$Log: L2jetAlgo2009.h,v \$
136  Revision 1.1 2010/04/17 05:04:13 pibero
137  Updates for Run 9 jet tree production
138
139  Revision 1.1 2007/11/19 22:18:28 balewski
140  most L2algos provide triggerID's
141
142  Revision 1.6 2007/11/14 03:58:14 balewski
143  cleanup of common timing measurement
144
145  Revision 1.5 2007/11/13 23:06:07 balewski
146  toward more unified L2-algos
147
148  Revision 1.4 2007/11/08 04:02:31 balewski
149  run on l2ana as well
150
151  Revision 1.3 2007/11/02 03:03:47 balewski
152  modified L2VirtualAlgo
153
154  Revision 1.2 2007/10/25 02:07:03 balewski
155  added L2upsilon & binary event dump
156
157  Revision 1.1 2007/10/11 00:33:20 balewski