Classes | |
class | SigInputObj |
class | SignAlgoResolutions |
Enumerations | |
enum | resolutionFunc { ET, PHI } |
enum | resolutionType { caloEE, caloEB, caloHE, caloHO, caloHF, caloHB, jet, electron, tau, muon } |
Functions | |
double | ASignificance (const std::vector< SigInputObj > &EventVec, double &met_r, double &met_phi, double &met_set) |
double | ASignificance (const std::vector< metsig::SigInputObj > &EventVec, double &met_r, double &met_phi, double &met_set) |
void | rotateMatrix (Double_t theta, TMatrixD &v) |
double metsig::ASignificance | ( | const std::vector< SigInputObj > & | EventVec, | |
double & | met_r, | |||
double & | met_phi, | |||
double & | met_set | |||
) |
Definition at line 44 of file significanceAlgo.cc.
References TestMuL1L2Filter_cff::cerr, funct::cos(), VarParsing::obj, Pi, funct::pow(), rotateMatrix(), funct::sin(), and funct::sqrt().
Referenced by pat::PATMHTProducer::produce().
00045 { 00046 00047 if(EventVec.size()<1) { 00048 std::cerr << "Event Vector is empty! Return -1:\n"; 00049 return(-1); 00050 } 00051 //=== Analytical Generation of Chisq Contours ===// 00052 double set_worker = 0; 00053 double xmet=0, ymet=0; 00054 double chisq0; 00055 00056 //--- Temporary variables ---// 00057 TMatrixD v_tmp(2,2); 00058 TMatrixD v_tot(2,2); 00059 TVectorD metvec(2); 00060 00061 //--- Initialize sum of rotated covariance matrices ---// 00062 v_tot(0,0)=0; v_tot(0,1)=0; v_tot(1,0)=0; v_tot(1,1)=0; 00063 00064 //--- Loop over physics objects in the event ---// 00065 // for(unsigned int objnum=1; objnum < EventVec.size(); objnum++ ) { 00066 for(std::vector<SigInputObj>::const_iterator obj = EventVec.begin(); obj!= EventVec.end(); ++obj){ 00067 double et_tmp = obj->get_energy(); 00068 double phi_tmp = obj->get_phi(); 00069 double sigma_et = obj->get_sigma_e(); 00070 double sigma_tan = obj->get_sigma_tan(); 00071 00072 double xval = et_tmp * cos( phi_tmp ); 00073 double yval = et_tmp * sin( phi_tmp ); 00074 xmet -= xval; 00075 ymet -= yval; 00076 set_worker += et_tmp; 00077 00078 //-- Initialize covariance matrix --// 00079 v_tmp(0,0) = pow( sigma_et, 2); 00080 v_tmp(0,1) = 0; v_tmp(1,0) = 0; 00081 v_tmp(1,1) = pow( sigma_tan, 2); 00082 00083 //-- rotate matrix --// 00084 rotateMatrix(phi_tmp,v_tmp); 00085 00086 //-- add to sum of rotated covariance matrices --// 00087 v_tot += v_tmp; 00088 } 00089 00090 00091 //--- Calculate magnitude and angle of MET, store in returned variables ---// 00092 met_r = sqrt(xmet*xmet + ymet*ymet); 00093 met_set = set_worker; 00094 //--- Ensure met_phi is in [-pi, pi] ---// 00095 double tmp_met_phi; 00096 if( (xmet) >=0.0 ) { 00097 tmp_met_phi = TMath::ATan( (ymet) / (xmet) ); 00098 } 00099 else { 00100 if( (ymet) >=0.0 ) { 00101 tmp_met_phi = TMath::ATan(ymet/xmet) + TMath::Pi(); 00102 } 00103 else{ // => ymet<0 00104 tmp_met_phi = TMath::ATan(ymet/xmet) - TMath::Pi(); 00105 } 00106 } 00107 met_phi = tmp_met_phi; 00108 00109 //--- Calculate Significance ---// 00110 v_tot.Invert(); 00111 metvec(0) = xmet; metvec(1) = ymet; 00112 chisq0 = metvec * (v_tot * metvec); 00113 double lnSignificance = 0.5 * chisq0; 00114 00115 return lnSignificance; 00116 }
double metsig::ASignificance | ( | const std::vector< metsig::SigInputObj > & | EventVec, | |
double & | met_r, | |||
double & | met_phi, | |||
double & | met_set | |||
) |
Referenced by SignCaloSpecificAlgo::addInfo().
void metsig::rotateMatrix | ( | Double_t | theta, | |
TMatrixD & | v | |||
) |
Definition at line 28 of file significanceAlgo.cc.
References funct::cos(), r, and funct::sin().
Referenced by ASignificance().
00029 { 00030 00031 TMatrixD r(2,2); 00032 TMatrixD rInv(2,2); 00033 00034 r(0,0) = cos(theta); r(0,1) = sin(theta); r(1,0) = -sin(theta); r(1,1) = cos(theta); 00035 rInv = r; 00036 rInv.Invert(); 00037 //-- Rotate v --// 00038 v = rInv * v * r; 00039 }