00001 #ifndef L2JETALGO2D_H
00002 #define L2JETALGO2D_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifdef IS_REAL_L2 //in l2-ana environmen
00015 #include "L2VirtualAlgo2009.h"
00016 #else
00017 #include "L2algoUtil/L2VirtualAlgo2009.h"
00018 #include "L2algoUtil/L2EmcGeom.h"
00019 #endif
00020
00021 class L2Histo;
00022 class L2Jet;
00023
00024
00025 class L2jetAlgo2009 : public L2VirtualAlgo2009 {
00026 public:
00027 enum {MaxBtowRdo=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)};
00028 enum {MaxEtowRdo=(EtowGeom::mxEtaBin) * (EtowGeom::mxPhiBin)};
00029 enum {cl2jetMaxEtaBins=15, cl2jetMaxPhiBins=30};
00030
00031
00032
00033
00034
00035 enum {cl2jet_par_mxPhiBin=5, cl2jet_par_mxEtaBin=5};
00036 private:
00037
00038
00039 int par_useBtowEast;
00040 int par_useBtowWest;
00041 int par_useEndcap;
00042 int par_minPhiBinDiff;
00043
00044 float par_diJetThrHigh;
00045 float par_diJetThrLow;
00046 float par_diJetThr_2;
00047 float par_diJetThr_3;
00048 float par_diJetThr_4;
00049 float par_diJetThr_5;
00050 float par_oneJetThr;
00051 float par_diJetEtaLow;
00052 float par_diJetEtaHigh;
00053 int par_dbg;
00054 int *raw_ints;
00055 float *raw_floats;
00056
00057 float par_hotTwEtThr;
00058
00059
00060 enum { mxHA=256, mxJ=2};
00061 L2Histo *hA[mxHA];
00062 long run_startUnix;
00063 int run_number;
00064 char namechar;
00065
00066
00067 int run_nEventOneJet, run_nEventDiJet, run_nEventRnd;
00068
00069
00070 unsigned short db_btowL2PhiBin[MaxBtowRdo];
00071 unsigned short db_btowL2PatchBin[MaxBtowRdo];
00072
00073
00074 unsigned short db_etowL2PhiBin[MaxEtowRdo];
00075 unsigned short db_etowL2PatchBin[MaxEtowRdo];
00076
00077 class L2Jet {
00078 public:
00079
00080
00081
00082 int iphiBin;
00083 float fphiBin;
00084 int ietaBin;
00085 float fetaBin;
00086 float iene;
00087 float phiRad;
00088 float eneGeV;
00089 float rmsEtaBin;
00090 float rmsPhiBin;
00091
00092 L2Jet(){};
00093 void clear(){
00094 iphiBin=ietaBin=0;
00095 fphiBin=fetaBin=phiRad=eneGeV=iene=0.;
00096 }
00097 };
00098
00099
00100 int eve_ID;
00101 float eve_patchEne[cl2jetMaxEtaBins*cl2jetMaxPhiBins];
00102 float eve_phiEne[cl2jetMaxPhiBins+cl2jet_par_mxPhiBin-1];
00103 L2Jet * eve_Jet[mxJ];
00104
00105
00106 void createHisto();
00107 void clearEvent();
00108 int projectAdc(const HitTower1 *hit, const int hitSize,
00109 ushort *phiBin, ushort *patchBin,
00110 L2Histo *hHot );
00111 float scanPhi();
00112 void scanEta(int iJ);
00113 float true2Dscan();
00114 void weightedEtaPhi(int iK);
00115 void weightedPhi(int iJ);
00116 void dumpPatchEneA();
00117 void finishRunHisto();
00118 bool paramsChanged( int *rc_ints, float *rc_floats);
00119 void computeE(int token);
00120
00121
00122
00123 public:
00124 L2jetAlgo2009(const char* name, L2EmcDb* db, char* outDir, int resOff, bool writeHighResult=false);
00125
00126 int initRunUser( int runNo, int *rc_ints, float *rc_floats);
00127 bool decisionUser(int token, int *myL2Result);
00128 void computeUser(int token);
00129 void finishRunUser();
00130 };
00131
00132 #endif
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167