#ifndef INC_MISSINGET #define INC_MISSINGET // //////////////////////////////////////////////////////////////////////////// // File: MissingET.hpp // // // // Purpose: Missing transverse energy object // // // // Created: 26-JUN-1998 John Womersley // // History: 10-JAN-1999 Laurent Duflot: to help compile on NT remove // // "using namespace std" .h to iostream // // 13-AUG-2000 Alan L. Stone: added more variables and methods // // to calculate MissingET with or without ET and Eta limits // // 15-AUG-2000 Alan L. Stone: Calculate ETx,ETy for each of the // // ieta rings (74) for each event // // 19-JAN-2001 Alan L. Stone: Calculate rings at zero vertex // // 20-MAR-2001 Alan L. Stone: Added MissingET constructor for // // pmcs missingET package. // // 13-APR-2001 Alan L. Stone: Subdivided rings into EM & Hadronic // // 04-JUN-2001 Alan L. Stone/George Alverson: Added extraction // // operator for MissingET object // // 02-AUG-2001 Laurent Duflot: add thumbnail code // // 25-NOV-2001 Vishnu Zutshi, Joe Steele: Added muon energies and // // new muon variables // // 12-FEB-2002 Alan L. Stone: Added new variables, methods for // // detailed MET analysis - including muon correction, cells, // // towers & ICD // // 20-FEB-2002 Alan L. Stone: Remove pmcs constructor; create set // // and get methods for everything; new initialization function // // 2-APR-2002 Sophie Trincaz-Duvoid/Alan L. Stone: fill // // NADA variables in MET block from CalNadaChunk // // 20-Feb-2003 Lee Sawyer: Major revision. // // No longer applying Et threshold. // // New variables added (No CH, CalT42, sums by layer). // // No separate cell-threshold is applied. // // 16-Oct-2003 Major revision // // Sophie Trincaz/Patrice Verdier/Andrey Zatserklyaniy // // Added new variables for META/METB and MET corrections // // 03-Feb-2004 Patrice Verdier // // Add new MET functions for corrected MET taking into // // account badjets // // //////////////////////////////////////////////////////////////////////////// // Dependencies (#includes) #include #include "kinem/D0PhysObj.hpp" #include "missingET/MetTmbObj.hpp" class CalData; class CalNada; class Calt42; //============================================================================== class MissingET{ friend class MetTmbObj; public: // Constructors MissingET(); // default constructor MissingET(CalData* cal, CalData* cal0, CalNada* noise, Calt42* t42ptr, const float _towerETLimitNoEta, const float _towerETLimitWithEta, const int _towerEtaLowLimit, const int _towerEtaHighLimit, const float sumMumom[4], const int _etaLimit=0, const float _towerThreshold=0., const float _cellThreshold=0.); MissingET(const MissingET& met); // copy constructor // destructor ~MissingET(); // methods void setMET(float &ScalarET, float &MEx, float &MEy, float &MET); float getScalarET(); void getMExy(float &ETx, float &ETy); float getMET(); void setMETNE(float &ScalarETNE, float &MExNE, float &MEyNE, float &METNE); float getScalarET_noeta(); void getMExy_noeta(float &ETx_noeta, float &ETy_noeta); float getMET_noeta(); void setMETWE(float &ScalarETWE, float &MExWE, float &MEyWE, float &METWE); float getScalarET_weta(); void getMExy_weta(float &ETx_weta, float &ETy_weta); float getMET_weta(); void getRings(const float *&RingEMx, const float *&RingEMy, const float *&RingHDx, const float *&RingHDy); void setVertex(float &Zvertex); void getZvertex(float &Zvertex); void setVisMu(float &visMuX, float &visMuY, float &visMuPt); void getVisMu(float &visMuX, float &visMuY, float &visMuPt); // Variables added 4/27/2002 void setMETT(float &SETT, float &METTx, float &METTy, float &METT); void getMETT(float &SETT, float &METTx, float &METTy, float &METT); void setMETTM(float &SETTM, float &METTMx, float &METTMy, float &METTM); void getMETTM(float &SETTM, float &METTMx, float &METTMy, float &METTM); void setVETTAS(float &SETTAS, float &VETTASx, float &VETTASy, float &VETTAS); void getVETTAS(float &SETTAS, float &VETTASx, float &VETTASy, float &VETTAS); void setVETTBS(float &SETTBS, float &VETTBSx, float &VETTBSy, float &VETTBS); void getVETTBS(float &SETTBS, float &VETTBSx, float &VETTBSy, float &VETTBS); void setVETTAN(float &SETTAN, float &VETTANx, float &VETTANy, float &VETTAN); void getVETTAN(float &SETTAN, float &VETTANx, float &VETTANy, float &VETTAN); void setVETTBN(float &SETTBN, float &VETTBNx, float &VETTBNy, float &VETTBN); void getVETTBN(float &SETTBN, float &VETTBNx, float &VETTBNy, float &VETTBN); void setMETC(float &SETC, float &METCx, float &METCy, float &METC); void getMETC(float &SETC, float &METCx, float &METCy, float &METC); void setMETCM(float &SETCM, float &METCMx, float &METCMy, float &METCM); void getMETCM(float &SETCM, float &METCMx, float &METCMy, float &METCM); void setVETCAS(float &SETCAS, float &VETCASx, float &VETCASy, float &VETCAS); void getVETCAS(float &SETCAS, float &VETCASx, float &VETCASy, float &VETCAS); void setVETCBS(float &SETCBS, float &VETCBSx, float &VETCBSy, float &VETCBS); void getVETCBS(float &SETCBS, float &VETCBSx, float &VETCBSy, float &VETCBS); void setVETCAN(float &SETCAN, float &VETCANx, float &VETCANy, float &VETCAN); void getVETCAN(float &SETCAN, float &VETCANx, float &VETCANy, float &VETCAN); void setVETCBN(float &SETCBN, float &VETCBNx, float &VETCBNy, float &VETCBN); void getVETCBN(float &SETCBN, float &VETCBNx, float &VETCBNy, float &VETCBN); void setVETICD(float &SETICD, float &VETICDx, float &VETICDy, float &VETICD); void getVETICD(float &SETICD, float &VETICDx, float &VETICDy, float &VETICD); void setVETNADA(float &SETNADA, float &VETNADAx, float &VETNADAy, float &VETNADA); void getVETNADA(float &SETNADA, float &VETNADAx, float &VETNADAy, float &VETNADA); void setVETMUON(float &VETMUONx, float &VETMUONy, float &VETMUONz, float &VETMUON); void getVETMUON(float &VETMUONx, float &VETMUONy, float &VETMUONz, float &VETMUON); // New variables added 2/20/2003 void setVETC(float &SETC, float &VETCx, float &VETCy, float &METC); void getVETC(float &SETC, float &VETCx, float &VETCy, float &METC); void setVETCM(float &SETCM, float &VETCMx, float &VETCMy, float &METCM); void getVETCM(float &SETCM, float &VETCMx, float &VETCMy, float &METCM); void setVETD(float &SETD, float &VETDx, float &VETDy, float &METD); void getVETD(float &SETD, float &VETDx, float &VETDy, float &METD); void setVETDM(float &SETDM, float &VETDMx, float &VETDMy, float &METDM); void getVETDM(float &SETDM, float &VETDMx, float &VETDMy, float &METDM); // Additional accessors for missing (and not visible) ET w/out CH void getMETD(float &SETD, float &METDx, float &METDy, float &METD); void getMETDM(float &SETDM, float &METDMx, float &METDMy, float &METDM); void setVETEM(float &SETEM, float &VETEMx, float &VETEMy, float &METEM); void getVETEM(float &SETEM, float &VETEMx, float &VETEMy, float &METEM); void setVETMG(float &SETMG, float &VETMGx, float &VETMGy, float &METMG); void getVETMG(float &SETMG, float &VETMGx, float &VETMGy, float &METMG); void setVETFH(float &SETFH, float &VETFHx, float &VETFHy, float &METFH); void getVETFH(float &SETFH, float &VETFHx, float &VETFHy, float &METFH); void setVETCH(float &SETCH, float &VETCHx, float &VETCHy, float &METCH); void getVETCH(float &SETCH, float &VETCHx, float &VETCHy, float &METCH); void setVETED(float &EDGE, float &SETED, float &VETEDx, float &VETEDy, float &METED); void getVETED(float &EDGE, float &SETED, float &VETEDx, float &VETEDy, float &METED); void setVETNG(float &SETNG, float &VETNGx, float &VETNGy, float &METNG); void getVETNG(float &SETNG, float &VETNGx, float &VETNGy, float &METNG); void setVET42(float &SET42, float &VET42x, float &VET42y, float &MET42); void getVET42(float &SET42, float &VET42x, float &VET42y, float &MET42); // New variables added 08-Oct-2003 (Patrice Verdier) // CH corrections : void getDMETACHxy(float &DMETACHx,float &DMETACHy) const; void getDMETBCHxy(float &DMETBCHx,float &DMETBCHy) const; void setDMETACHxy(float &DMETACHx,float &DMETACHy); void setDMETBCHxy(float &DMETBCHx,float &DMETBCHy); float getDMETACH() const; float getDMETBCH() const; float getSETACH() const; float getSETBCH() const; void setSETACH(float &SETACH); void setSETBCH(float &SETBCH); // Electron corrections : void getDMETAELxy(float &DMETAELx,float &DMETAELy) const; void getDMETBELxy(float &DMETBELx,float &DMETBELy) const; void setDMETAELxy(float &DMETAELx,float &DMETAELy); void setDMETBELxy(float &DMETBELx,float &DMETBELy); float getDMETAEL() const; float getDMETBEL() const; float getSETAEL() const; float getSETBEL() const; void setSETAEL(float &SETAEL); void setSETBEL(float &SETBEL); // JES corrections : void getDMETAJESxy(float &DMETAJESx,float &DMETAJESy) const; void getDMETBJESxy(float &DMETBJESx,float &DMETBJESy) const; void setDMETAJESxy(float &DMETAJESx,float &DMETAJESy); void setDMETBJESxy(float &DMETBJESx,float &DMETBJESy); float getDMETAJES() const; float getDMETBJES() const; float getSETAJES() const; float getSETBJES() const; void setSETAJES(float &SETAJES); void setSETBJES(float &SETBJES); // Muon corrections : void getDMETAMUxy(float &DMETAMUx,float &DMETAMUy) const; void getDMETBMUxy(float &DMETBMUx,float &DMETBMUy) const; void setDMETAMUxy(float &DMETAMUx,float &DMETAMUy); void setDMETBMUxy(float &DMETBMUx,float &DMETBMUy); float getDMETAMU() const; float getDMETBMU() const; float getSETAMU() const; float getSETBMU() const; void setSETAMU(float &SETAMU); void setSETBMU(float &SETBMU); // Unclustered energy corrections : void getDMETAUExy(float &DMETAUEx,float &DMETAUEy) const; void getDMETBUExy(float &DMETBUEx,float &DMETBUEy) const; void setDMETAUExy(float &DMETAUEx,float &DMETAUEy); void setDMETBUExy(float &DMETBUEx,float &DMETBUEy); float getDMETAUE() const; float getDMETBUE() const; float getSETAUE() const; float getSETBUE() const; void setSETAUE(float &SETAUE); void setSETBUE(float &SETBUE); // Bad jets corrections : void getDMETABJxy(float &DMETABJx,float &DMETABJy) const; void getDMETBBJxy(float &DMETBBJx,float &DMETBBJy) const; void setDMETABJxy(float &DMETABJx,float &DMETABJy); void setDMETBBJxy(float &DMETBBJx,float &DMETBBJy); float getDMETABJ() const; float getDMETBBJ() const; float getSETABJ() const; float getSETBBJ() const; void setSETABJ(float &SETABJ); void setSETBBJ(float &SETBBJ); // New accessor functions : float getMETA() const; float getMETB() const; void getMETAxy(float &METx,float &METy) const; void getMETBxy(float &METx,float &METy) const; float getSETA() const; float getSETB() const; float getMETACorrCALO() const; float getMETBCorrCALO() const; void getMETACorrCALOxy(float &METx,float &METy) const; void getMETBCorrCALOxy(float &METx,float &METy) const; float getSETACorrCALO() const; float getSETBCorrCALO() const; float getMETACorrCALOMU() const; float getMETBCorrCALOMU() const; void getMETACorrCALOMUxy(float &METx,float &METy) const; void getMETBCorrCALOMUxy(float &METx,float &METy) const; float getSETACorrCALOMU() const; float getSETBCorrCALOMU() const; float getMETACorrCALOBJ() const; float getMETBCorrCALOBJ() const; void getMETACorrCALOBJxy(float &METx,float &METy) const; void getMETBCorrCALOBJxy(float &METx,float &METy) const; float getSETACorrCALOBJ() const; float getSETBCorrCALOBJ() const; float getMETACorrCALOMUBJ() const; float getMETBCorrCALOMUBJ() const; void getMETACorrCALOMUBJxy(float &METx,float &METy) const; void getMETBCorrCALOMUBJxy(float &METx,float &METy) const; float getSETACorrCALOMUBJ() const; float getSETBCorrCALOMUBJ() const; // print methods void print(std::ostream &os) const; void print_noeta(std::ostream &os) const; void print_weta(std::ostream &os) const; void print_METT(std::ostream &os) const; void print_METTM(std::ostream &os) const; void print_VETMUON(std::ostream &os) const; void print_VETTAS(std::ostream &os) const; void print_VETTBS(std::ostream &os) const; void print_VETTAN(std::ostream &os) const; void print_VETTBN(std::ostream &os) const; void print_METC(std::ostream &os) const; void print_METCM(std::ostream &os) const; void print_VETCAS(std::ostream &os) const; void print_VETCBS(std::ostream &os) const; void print_VETCAN(std::ostream &os) const; void print_VETCBN(std::ostream &os) const; void print_VETICD(std::ostream &os) const; void print_VETNADA(std::ostream &os) const; void print_VETD(std::ostream &os) const; void print_VETDM(std::ostream &os) const; void print_VETEM(std::ostream &os) const; void print_VETMG(std::ostream &os) const; void print_VETFH(std::ostream &os) const; void print_VETCH(std::ostream &os) const; void print_VETED(std::ostream &os) const; void print_VETNG(std::ostream &os) const; void print_VET42(std::ostream &os) const; void print_DMETACH(std::ostream &os) const; void print_DMETBCH(std::ostream &os) const; void print_DMETAEL(std::ostream &os) const; void print_DMETBEL(std::ostream &os) const; void print_DMETAJES(std::ostream &os) const; void print_DMETBJES(std::ostream &os) const; void print_DMETAMU(std::ostream &os) const; void print_DMETBMU(std::ostream &os) const; void print_DMETAUE(std::ostream &os) const; void print_DMETBUE(std::ostream &os) const; void print_DMETABJ(std::ostream &os) const; void print_DMETBBJ(std::ostream &os) const; // extractor for MissingET friend std::ostream & operator<< (std::ostream &os, const MissingET &obj); //Information for Thumbnail #ifndef __CINT__ // return ThumbNail information MetTmbObj getThumbNail() const; // unpack ThumbNail information void unpThumbNail(const MetTmbObj* tmbptr); #endif void unpThumbNail(kinem::TmbObj& tmbobj); private: //===========================================// // old variable set // // no Tower Energy or Eta Limits float _MET; float _MEx; float _MEy; float _ScalarET; // with Tower Energy limit only float _MET_noeta; float _MEx_noeta; float _MEy_noeta; float _ScalarET_noeta; // with Tower Energy and Eta limits float _MET_weta; float _MEx_weta; float _MEy_weta; float _ScalarET_weta; // Ring variables: 42 ieta rings each with EM & HAD components float _RingEMx[NRING]; float _RingEMy[NRING]; float _RingHDx[NRING]; float _RingHDy[NRING]; float _visMuMom[4]; float _Zvertex; //===============================================// // p11 new variable set // // MET for CAL + ICD Towers float _SETT; float _METTx; float _METTy; float _METT; // MET for CAL + ICD Towers + Muon correction float _SETTM; float _METTMx; float _METTMy; float _METTM; // Vis. Et for CAL + ICD Towers above eta limit, above tower threshold float _SETTAS; float _VETTASx; float _VETTASy; float _VETTAS; // Vis. Et for CAL + ICD Towers below eta limit, above tower threshold float _SETTBS; float _VETTBSx; float _VETTBSy; float _VETTBS; // Vis. Et for CAL + ICD Towers above eta limit, below tower threshold float _SETTAN; float _VETTANx; float _VETTANy; float _VETTAN; // Vis. Et for CAL + ICD Towers below eta limit, below tower threshold float _SETTBN; float _VETTBNx; float _VETTBNy; float _VETTBN; // MET for CAL + ICD Cells float _SETC; float _METCx; float _METCy; float _METC; // MET for CAL + ICD Cells + Muon correction float _SETCM; float _METCMx; float _METCMy; float _METCM; // Vis. Et for CAL + ICD Cells above eta limit, above cell threshold float _SETCAS; float _VETCASx; float _VETCASy; float _VETCAS; // Vis. Et for CAL + ICD Cells below eta limit, above cell threshold float _SETCBS; float _VETCBSx; float _VETCBSy; float _VETCBS; // Vis. Et for CAL + ICD Cells above eta limit, below cell threshold float _SETCAN; float _VETCANx; float _VETCANy; float _VETCAN; // Vis. Et for CAL + ICD Cells below eta limit, below cell threshold float _SETCBN; float _VETCBNx; float _VETCBNy; float _VETCBN; // Vis. Et for ICD Cells float _SETICD; float _VETICDx; float _VETICDy; float _VETICD; // Vis. Et for NADA Cells float _SETNADA; float _VETNADAx; float _VETNADAy; float _VETNADA; // Tight Muons float _VETMUONx; float _VETMUONy; float _VETMUONz; float _VETMUON; //====================================================// // p15 new variable set (2/20/2003) // // it is in p14 and p15 indeed : Patrice (08-Oct-2003)// // MET for CAL + ICD Cells float _VETCx; // _METCx and _METCy already declared float _VETCy; // MET for CAL + ICD Cells + Muon correction float _VETCMx; // _METCMx and METCMy already declared float _VETCMy; // MET for CAL + ICD Cells layers 1-14 (no CH) float _SETD; float _VETDx; float _VETDy; float _METD; // MET for CAL + ICD Cells layers 1-14 (no CH) + Muon correction float _SETDM; float _VETDMx; float _VETDMy; float _METDM; // MET for EM layers (1-7) float _SETEM; float _VETEMx; float _VETEMy; float _METEM; // MET for Massless Gap layers (8&10) float _SETMG; float _VETMGx; float _VETMGy; float _METMG; // MET for FH layers (11-14) float _SETFH; float _VETFHx; float _VETFHy; float _METFH; // MET for CH layers (15-17) float _SETCH; float _VETCHx; float _VETCHy; float _METCH; // MET for CAL + ICD Cells below eta limit.(no threshold) float _EDge; float _SETED; float _VETEDx; float _VETEDy; float _METED; // MET for negative cells float _SETNG; float _VETNGx; float _VETNGy; float _METNG; // MET for noise cells, based onthe CalT42 algorithm. float _SET42; float _VET42x; float _VET42y; float _MET42; // Define just MET qunatities for ICD, NADA, and MUON float _METICD; float _METNADA; float _METMUON; //====================================================// // p14 variables for corrected missingET (d0corr) // // all these variables are indeed corrections to be // // added to MET and not corrected MET // // Corrections are not computed in the missingEt // // package but in the d0corr package which creates a // // new MissingETChunk // //====================================================// // Coarse Hadronic : // loop over jets and take CH fraction of good jets float _DMETACHx; float _DMETACHy; float _SETACH; float _DMETBCHx; float _DMETBCHy; float _SETBCH; // Electrons : // a) match electrons with jets // b) remove electrons from jet list // c) correct electron energies with EM energy scale. // d) compute MET correction // Remarks : what happens if we have an electron of 10 GeV in a jet of 50 GeV ? // Electron R=0.4, and jets R=0.5 or 0.7 : it should not happen often float _DMETAELx; float _DMETAELy; float _SETAEL; float _DMETBELx; float _DMETBELy; float _SETBEL; // Jet Energy Scale : // a) Match muons with jets // b) add the muon to the jet in jetcorr object : jetcorr::addMuon() // c) compute JES correction and get MET correction : jetcorr::forMET() // Warning : we check with Andrey that the MET correction in jetcorr // do not take into account the muon. MET for Matched muons must be // corrected as for non-matched muons (to be checked with JES group) float _DMETAJESx; float _DMETAJESy; float _SETAJES; float _DMETBJESx; float _DMETBJESy; float _SETBJES; // Muons : // Correct missing ET from muons : // a) add muon 4-vectors // b) treat also muon energy deposit in the calorimeter float _DMETAMUx; float _DMETAMUy; float _SETAMU; float _DMETBMUx; float _DMETBMUy; float _SETBMU; // Unclustered energy : // We will perform a calibration of the unclustered energy. // The correction should be an analytic function, but it could be more // complicated than that. So let's reserve variables for that correction float _DMETAUEx; float _DMETAUEy; float _SETAUE; float _DMETBUEx; float _DMETBUEy; float _SETBUE; // bad jets : // What are we doing with bad jets ? (bad jets = the ones which do not pass // good jet criteria and the ones for which we cannot apply the JES correction // because there are eta and Pt cuts. float _DMETABJx; float _DMETABJy; float _SETABJ; float _DMETBBJx; float _DMETBBJy; float _SETBBJ; // Open questions : we may need to add some variables // a) Some electrons are also good jets ? // b) Unclustered energy = everything out of cone. Is it consistent with JES corrections ? // initialize constructor void setAllZero(void); }; inline std::ostream & operator<< (std::ostream &os, const MissingET &obj) { obj.print (os); return os; } #endif // INC_MISSINGET