/**************************************************************************************** // // ROOT macro to apply object-level quality cuts // EXAMPLE of how to use: root -l .L checkOQ.C++; egammaOQ myOQ; myOQ.checkOQClusterPhoton(152209, 0.6, 1.2, false); //(put "true" if converted) myOQ.checkOQClusterElectron(152209, -1.4, 2.2); IF I GET 3 AS OUTPUT I HAVE TO REJECT THE CLUSTER IMPORTANT NOTE: It is recommended to use the eta and phi of the cluster! **********************************************************************************/ #include "checkOQ.h" #include using std::abs; #include //ClassImp(egammaOQ) egammaOQ::egammaOQ( string /*name*/ ) { //TNamed::SetName( name.c_str() ); m_RunFracMC.push_back(0.07); m_RunFracMC.push_back(0.41); m_RunFracMC.push_back(0.42); m_RunFracMC.push_back(0.10); } egammaOQ::~egammaOQ() { } int egammaOQ::setLumiVec(double Per1,double Per2,double Per3,double Per4) { m_LumiVec.push_back(Per1); m_LumiVec.push_back(Per2); m_LumiVec.push_back(Per3); m_LumiVec.push_back(Per4); return 0; } double egammaOQ::getOQWeight(int runnumber) const { double OQWeight= -999.; if( m_LumiVec.size() != 4) std::cout << "Wrong lumi vector in input !" << std::endl; double TotLumi = 0; for(unsigned int i=0;i " << myEta << " " << myPhi << std::endl; double etaCell = myEta; double phiCell = myPhi; // Check the whole cluster // if (verbose) std::cout << "checking the whole cluster..." << endl; int clusFull = deadRegionS2(etaCell, phiCell, NetaCells*0.025/2., NphiCells*0.025/2., candidate, verbose); return(clusFull); } // // Check for dead regions in S2 int egammaOQ::deadRegionS2(double myEta, double myPhi, double deltaEta, double deltaPhi, int /*candidate*/, bool /*verbose*/) const { int theValue= 0; double etaLowBound=myEta-deltaEta; double etaUpBound=myEta+deltaEta; double phiLowBound=myPhi-deltaPhi; double phiUpBound=myPhi+deltaPhi; const double pi = TMath::Pi(); if(phiLowBound<-pi) phiLowBound += 2.*pi; //crossing the lower bound in Phi if(phiUpBound> pi) phiUpBound -= 2.*pi; //crossing upper bound in Phi //4 dead Febs from run 180614: eta-phi range: [0.0,1.45] x [-0.78847,-0.59213] //S2 if(etaLowBound>=0. && etaLowBound <=1.45) { if( phiLowBound>=-0.78847 && phiLowBound<=-0.59213) return 3; if( phiUpBound>=-0.78847 && phiUpBound<=-0.59213) return 3; } if(etaUpBound>=0. && etaUpBound <=1.45) { if( phiLowBound>=-0.78847 && phiLowBound<=-0.59213) return 3; if( phiUpBound>=-0.78847 && phiUpBound<=-0.59213) return 3; } return(theValue); }