CMS 3D CMS Logo

MuonCaloCompatibility Class Reference

#include <RecoMuon/MuonIdentification/interface/MuonCaloCompatibility.h>

List of all members.

Public Member Functions

void configure (const edm::ParameterSet &)
double evaluate (const reco::Muon &)
 MuonCaloCompatibility ()

Private Member Functions

bool accessing_overflow (TH2D *histo, double x, double y)

Private Attributes

bool isConfigured_
double muon_compatibility
TH2D * muon_em_etaB
TH2D * muon_em_etaEmi
TH2D * muon_em_etaEpl
TH2D * muon_em_etaTmi
TH2D * muon_em_etaTpl
TH2D * muon_had_etaB
TH2D * muon_had_etaEmi
TH2D * muon_had_etaEpl
TH2D * muon_had_etaTmi
TH2D * muon_had_etaTpl
TH2D * muon_ho_etaB
TH2D * muon_template_em
TH2D * muon_template_had
TH2D * muon_template_ho
TFile * muon_templates
std::string MuonfileName_
double pbx
double pby
double pbz
TH2D * pion_em_etaB
TH2D * pion_em_etaEmi
TH2D * pion_em_etaEpl
TH2D * pion_em_etaTmi
TH2D * pion_em_etaTpl
TH2D * pion_had_etaB
TH2D * pion_had_etaEmi
TH2D * pion_had_etaEpl
TH2D * pion_had_etaTmi
TH2D * pion_had_etaTpl
TH2D * pion_ho_etaB
TH2D * pion_template_em
TH2D * pion_template_had
TH2D * pion_template_ho
TFile * pion_templates
std::string PionfileName_
double psx
double psy
double psz
bool use_corrected_hcal
bool use_em_special


Detailed Description

Definition at line 27 of file MuonCaloCompatibility.h.


Constructor & Destructor Documentation

MuonCaloCompatibility::MuonCaloCompatibility (  )  [inline]

Definition at line 29 of file MuonCaloCompatibility.h.

00029 :isConfigured_(false){}


Member Function Documentation

bool MuonCaloCompatibility::accessing_overflow ( TH2D *  histo,
double  x,
double  y 
) [private]

Definition at line 75 of file MuonCaloCompatibility.cc.

Referenced by evaluate().

00075                                                                                 {
00076   bool access = false;
00077 
00078   if( histo->GetXaxis()->FindBin(x) == 0 || 
00079       histo->GetXaxis()->FindBin(x) > histo->GetXaxis()->GetNbins() ) {
00080     access = true;
00081   }
00082   if( histo->GetYaxis()->FindBin(y) == 0 || 
00083       histo->GetYaxis()->FindBin(y) > histo->GetYaxis()->GetNbins() ) {
00084     access = true;
00085   }
00086   return access;
00087 }

void MuonCaloCompatibility::configure ( const edm::ParameterSet iConfig  ) 

Definition at line 20 of file MuonCaloCompatibility.cc.

References edm::ParameterSet::getParameter(), isConfigured_, muon_compatibility, muon_em_etaB, muon_em_etaEmi, muon_em_etaEpl, muon_em_etaTmi, muon_em_etaTpl, muon_had_etaB, muon_had_etaEmi, muon_had_etaEpl, muon_had_etaTmi, muon_had_etaTpl, muon_ho_etaB, muon_templates, MuonfileName_, pbx, pby, pbz, pion_em_etaB, pion_em_etaEmi, pion_em_etaEpl, pion_em_etaTmi, pion_em_etaTpl, pion_had_etaB, pion_had_etaEmi, pion_had_etaEpl, pion_had_etaTmi, pion_had_etaTpl, pion_ho_etaB, pion_templates, PionfileName_, psx, psy, psz, use_corrected_hcal, and use_em_special.

Referenced by CaloMuonProducer::CaloMuonProducer(), and MuonIdProducer::MuonIdProducer().

00021 {
00022    MuonfileName_ = (iConfig.getParameter<edm::FileInPath>("MuonTemplateFileName")).fullPath();
00023    PionfileName_ = (iConfig.getParameter<edm::FileInPath>("PionTemplateFileName")).fullPath();
00024    muon_templates = new TFile(MuonfileName_.c_str(),"READ");
00025    pion_templates = new TFile(PionfileName_.c_str(),"READ");
00026 
00027 
00028    pion_em_etaEmi  = (TH2D*) pion_templates->Get("em_etaEmi");
00029    pion_had_etaEmi = (TH2D*) pion_templates->Get("had_etaEmi");
00030                 
00031    pion_em_etaTmi  = (TH2D*) pion_templates->Get("em_etaTmi");
00032    pion_had_etaTmi = (TH2D*) pion_templates->Get("had_etaTmi");
00033                 
00034    pion_em_etaB    = (TH2D*) pion_templates->Get("em_etaB");
00035    pion_had_etaB   = (TH2D*) pion_templates->Get("had_etaB");
00036    pion_ho_etaB    = (TH2D*) pion_templates->Get("ho_etaB");
00037    
00038    pion_em_etaTpl  = (TH2D*) pion_templates->Get("em_etaTpl");
00039    pion_had_etaTpl = (TH2D*) pion_templates->Get("had_etaTpl");
00040                 
00041    pion_em_etaEpl  = (TH2D*) pion_templates->Get("em_etaEpl");
00042    pion_had_etaEpl = (TH2D*) pion_templates->Get("had_etaEpl");
00043                 
00044    muon_em_etaEmi  = (TH2D*) muon_templates->Get("em_etaEmi");
00045    muon_had_etaEmi = (TH2D*) muon_templates->Get("had_etaEmi");
00046                 
00047    muon_em_etaTmi  = (TH2D*) muon_templates->Get("em_etaTmi");
00048    muon_had_etaTmi = (TH2D*) muon_templates->Get("had_etaTmi");
00049                 
00050    muon_em_etaB    = (TH2D*) muon_templates->Get("em_etaB");
00051    muon_had_etaB   = (TH2D*) muon_templates->Get("had_etaB");
00052    muon_ho_etaB    = (TH2D*) muon_templates->Get("ho_etaB");
00053                 
00054    muon_em_etaTpl  = (TH2D*) muon_templates->Get("em_etaTpl");
00055    muon_had_etaTpl = (TH2D*) muon_templates->Get("had_etaTpl");
00056                 
00057    muon_em_etaEpl  = (TH2D*) muon_templates->Get("em_etaEpl");
00058    muon_had_etaEpl = (TH2D*) muon_templates->Get("had_etaEpl");
00059 
00060    pbx = -1;
00061    pby = -1;
00062    pbz = -1;
00063 
00064    psx = -1;
00065    psy = -1;
00066    psz = -1;
00067 
00068    muon_compatibility = -1;
00069 
00070    use_corrected_hcal = true;
00071    use_em_special = true;
00072    isConfigured_ = true;
00073 }

double MuonCaloCompatibility::evaluate ( const reco::Muon amuon  ) 

Definition at line 89 of file MuonCaloCompatibility.cc.

References accessing_overflow(), reco::Muon::calEnergy(), em, eta, reco::TrackBase::eta(), Exception, isConfigured_, LogTrace, muon_compatibility, muon_em_etaB, muon_em_etaEmi, muon_em_etaEpl, muon_em_etaTmi, muon_em_etaTpl, muon_had_etaB, muon_had_etaEmi, muon_had_etaEpl, muon_had_etaTmi, muon_had_etaTpl, muon_ho_etaB, muon_template_em, muon_template_had, muon_template_ho, NULL, reco::TrackBase::p(), p, pbx, pby, pbz, pion_em_etaB, pion_em_etaEmi, pion_em_etaEpl, pion_em_etaTmi, pion_em_etaTpl, pion_had_etaB, pion_had_etaEmi, pion_had_etaEpl, pion_had_etaTmi, pion_had_etaTpl, pion_ho_etaB, pion_template_em, pion_template_had, pion_template_ho, psx, psy, psz, funct::sin(), reco::Muon::standAloneMuon(), reco::TrackBase::theta(), reco::Muon::track(), track, use_corrected_hcal, and use_em_special.

Referenced by CaloMuonProducer::makeMuon(), and MuonIdProducer::produce().

00089                                                               {
00090   if (! isConfigured_) {
00091      edm::LogWarning("MuonIdentification") << "MuonCaloCompatibility is not configured! Nothing is calculated.";
00092      return -9999;
00093   }
00094    
00095   double eta = 0.;
00096   double p   = 0.;
00097   double em  = 0.;
00098   double had = 0.;
00099   double ho  = 0.;
00100 
00101   // had forgotten this reset in previous versions 070409
00102   pbx = 1.;
00103   pby = 1.;
00104   pbz = 1.;
00105 
00106   psx = 1.;
00107   psy = 1.;
00108   psz = 1.;
00109 
00110   muon_compatibility = -1.;
00111   
00112   pion_template_em   = NULL;
00113   muon_template_em   = NULL;
00114   
00115   pion_template_had  = NULL;
00116   muon_template_had  = NULL;
00117   
00118   pion_template_ho   = NULL;
00119   muon_template_ho   = NULL;
00120   
00121   // 071002: Get either tracker track, or SAmuon track.
00122   // CaloCompatibility templates may have to be specialized for 
00123   // the use with SAmuons, currently just using the ones produced
00124   // using tracker tracks. 
00125   const reco::Track* track = 0;
00126   if ( ! amuon.track().isNull() ) {
00127     track = amuon.track().get();
00128   }
00129   else {
00130     if ( ! amuon.standAloneMuon().isNull() ) {
00131       track = amuon.standAloneMuon().get();
00132     }
00133     else {
00134       throw cms::Exception("FatalError") << "Failed to fill muon id calo_compatibility information for a muon with undefined references to tracks"; 
00135     }
00136   }
00137 
00138   if( !use_corrected_hcal ) { // old eta regions, uncorrected energy
00139     eta = track->eta();
00140     p   = track->p(); 
00141 
00142     // new 070904: Set lookup momentum to 1999.9 if larger than 2 TeV. 
00143     // Though the templates were produced with p<2TeV, we believe that
00144     // this approximation should be roughly valid. A special treatment
00145     // for >1 TeV muons is advisable anyway :)
00146     if( p>=2000. ) p = 1999.9;
00147 
00148     //    p   = 10./sin(track->theta()); // use this for templates < 1_5
00149     if( use_em_special ) {
00150       if( amuon.calEnergy().em == 0. )    em  = -5.;
00151       else em  = amuon.calEnergy().em;
00152     }
00153     else {
00154       em  = amuon.calEnergy().em;
00155     }
00156     had = amuon.calEnergy().had;
00157     ho  = amuon.calEnergy().ho;
00158   }
00159   else {
00160     eta = track->eta();
00161     p   = track->p();
00162     
00163     // new 070904: Set lookup momentum to 1999.9 if larger than 2 TeV. 
00164     // Though the templates were produced with p<2TeV, we believe that
00165     // this approximation should be roughly valid. A special treatment
00166     // for >1 TeV muons is advisable anyway :)
00167     if( p>=2000. ) p = 1999.9;
00168 
00169     //    p   = 10./sin(track->theta());  // use this for templates < 1_5
00170     // hcal energy is now done where we get the template histograms (to use corrected cal energy)!
00171     //     had = amuon.calEnergy().had;
00172     if( use_em_special ) {
00173       if( amuon.calEnergy().em == 0. )    em  = -5.;
00174       else em  = amuon.calEnergy().em;
00175     }
00176     else {
00177       em  = amuon.calEnergy().em;
00178     }
00179     ho  = amuon.calEnergy().ho;
00180   }
00181 
00182 
00183   // Skip everyting and return "I don't know" (i.e. 0.5) for uncovered regions:
00184   //  if( p < 0. || p > 500.) return 0.5; // removed 500 GeV cutoff 070817 after updating the tempates (v2_0) to have valid entried beyond 500 GeV
00185   if( p < 0. ) return 0.5; // return "unknown" for unphysical momentum input.
00186   if( fabs(eta) >  2.5 ) return 0.5; 
00187 
00188   //  std::cout<<std::endl<<"Input values are: "<<eta <<" "<< p <<" "<< em <<" "<< had <<" "<< ho;
00189 
00190   //  depending on the eta, choose correct histogram: (now all for barrel):
00191   // bad! eta range has to be syncronised with choice for histogram... should be read out from the histo file somehow... 070322
00192   if(42 != 42) { // old eta ranges and uncorrected hcal energy
00193     if(eta <= -1.4) {
00194       //    std::cout<<"Emi"<<std::endl;
00195       pion_template_em  = pion_em_etaEmi;
00196       pion_template_had = pion_had_etaEmi;
00197       muon_template_em  = muon_em_etaEmi;
00198       muon_template_had = muon_had_etaEmi;
00199     }
00200     else if(eta > -1.4 && eta <= -1.31) {
00201       //    std::cout<<"Tmi"<<std::endl;
00202       pion_template_em  = pion_em_etaTmi;
00203       pion_template_had = pion_had_etaTmi;
00204       muon_template_em  = muon_em_etaTmi;
00205       muon_template_had = muon_had_etaTmi;
00206     }
00207     else if(eta > -1.31 && eta <= 1.31) {
00208       //    std::cout<<"B"<<std::endl;
00209       pion_template_em  = pion_em_etaB;
00210       pion_template_had = pion_had_etaB;
00211       pion_template_ho  = pion_ho_etaB;
00212       muon_template_em  = muon_em_etaB;
00213       muon_template_had = muon_had_etaB;
00214       muon_template_ho  = muon_ho_etaB;
00215     }
00216     else if(eta > 1.31 && eta <= 1.4) {
00217       //    std::cout<<"Tpl"<<std::endl;
00218       pion_template_em  = pion_em_etaTpl;
00219       pion_template_had = pion_had_etaTpl;
00220       muon_template_em  = muon_em_etaTpl;
00221       muon_template_had = muon_had_etaTpl;
00222     }
00223     else if(eta > 1.4) {
00224       //    std::cout<<"Epl"<<std::endl;
00225       pion_template_em  = pion_em_etaEpl;
00226       pion_template_had = pion_had_etaEpl;
00227       muon_template_em  = muon_em_etaEpl;
00228       muon_template_had = muon_had_etaEpl;
00229     }
00230     else {
00231       LogTrace("MuonIdentification")<<"Some very weird thing happened in MuonCaloCompatibility::evaluate - go figure ;) ";
00232       return -999;
00233     }
00234   }
00235   else if( 42 == 42 ) { // new eta bins, corrected hcal energy
00236     if(  track->eta() >  1.27  ) {
00237       //        had_etaEpl ->Fill(muon->track().get()->p(),1.8/2.2*muon->calEnergy().had );
00238       if(use_corrected_hcal)    had = 1.8/2.2*amuon.calEnergy().had;
00239       else      had = amuon.calEnergy().had;
00240       pion_template_had = pion_had_etaEpl;
00241       muon_template_had = muon_had_etaEpl;
00242     }
00243     if( track->eta() <=  1.27  && track->eta() >  1.1 ) {
00244       //        had_etaTpl ->Fill(muon->track().get()->p(),(1.8/(-2.2*muon->track().get()->eta()+5.5))*muon->calEnergy().had );
00245       if(use_corrected_hcal)    had = (1.8/(-2.2*track->eta()+5.5))*amuon.calEnergy().had;
00246       else      had = amuon.calEnergy().had;
00247       pion_template_had  = pion_had_etaTpl;
00248       muon_template_had  = muon_had_etaTpl;
00249     }
00250     if( track->eta() <=  1.1 && track->eta() > -1.1 ) {
00251       //        had_etaB   ->Fill(muon->track().get()->p(),sin(muon->track().get()->theta())*muon->calEnergy().had );
00252       if(use_corrected_hcal)    had = sin(track->theta())*amuon.calEnergy().had;
00253       else      had = amuon.calEnergy().had;
00254       pion_template_had  = pion_had_etaB;
00255       muon_template_had  = muon_had_etaB;
00256     }
00257     if( track->eta() <= -1.1 && track->eta() > -1.27 ) {
00258       //        had_etaTmi ->Fill(muon->track().get()->p(),(1.8/(-2.2*muon->track().get()->eta()+5.5))*muon->calEnergy().had );
00259       if(use_corrected_hcal)    had = (1.8/(2.2*track->eta()+5.5))*amuon.calEnergy().had;
00260       else      had = amuon.calEnergy().had;
00261       pion_template_had = pion_had_etaTmi;
00262       muon_template_had = muon_had_etaTmi;
00263     }
00264     if( track->eta() <= -1.27 ) {
00265       //        had_etaEmi ->Fill(muon->track().get()->p(),1.8/2.2*muon->calEnergy().had );
00266       if(use_corrected_hcal)    had = 1.8/2.2*amuon.calEnergy().had;
00267       else      had = amuon.calEnergy().had;
00268       pion_template_had = pion_had_etaEmi;
00269       muon_template_had = muon_had_etaEmi;
00270     }
00271     
00272     // just two eta regions for Ecal (+- 1.479 for barrel, else for rest), no correction:
00273 
00274     //    std::cout<<"We have a muon with an eta of: "<<track->eta()<<std::endl;
00275 
00276     if(  track->eta() >  1.479  ) {
00277       //        em_etaEpl  ->Fill(muon->track().get()->p(),muon->calEnergy().em   );
00278       //        //      em_etaTpl  ->Fill(muon->track().get()->p(),muon->calEnergy().em   );
00280       pion_template_em  = pion_em_etaEpl;
00281       muon_template_em  = muon_em_etaEpl;
00282     }
00283     if( track->eta() <=  1.479 && track->eta() > -1.479 ) {
00284       //        em_etaB    ->Fill(muon->track().get()->p(),muon->calEnergy().em   );
00286       pion_template_em  = pion_em_etaB;
00287       muon_template_em  = muon_em_etaB;
00288     }
00289     if( track->eta() <= -1.479 ) {
00290       //        //      em_etaTmi  ->Fill(muon->track().get()->p(),muon->calEnergy().em   );
00291       //        em_etaEmi  ->Fill(muon->track().get()->p(),muon->calEnergy().em   );
00293       pion_template_em  = pion_em_etaEmi;
00294       muon_template_em  = muon_em_etaEmi;
00295     }
00296     
00297     // just one barrel eta region for the HO, no correction
00298     //    if( track->eta() < 1.4 && track->eta() > -1.4 ) { // experimenting now...
00299     if( track->eta() < 1.28 && track->eta() > -1.28 ) {
00300       //        ho_etaB    ->Fill(muon->track().get()->p(),muon->calEnergy().ho   );
00302       pion_template_ho  = pion_ho_etaB;
00303       muon_template_ho  = muon_ho_etaB;
00304     }
00305 
00306     
00307   }
00308 
00309 
00310   if( 42 != 42 ) { // check validity of input template histos and input variables"
00311     pion_template_em ->ls();
00312     pion_template_had->ls();
00313     if(pion_template_ho)   pion_template_ho ->ls();
00314     muon_template_em ->ls();
00315     muon_template_had->ls();
00316     if(muon_template_ho)   muon_template_ho ->ls();
00317 
00318     LogTrace("MuonIdentification")<<"Input variables: eta    p     em     had    ho "<<"\n"
00319              <<eta<<" "<<p<<" "<<em<<" "<<had<<" "<<ho<<" "<<"\n"
00320              <<"cal uncorr:    em     had    ho "<<"\n"
00321              <<eta<<" "<<p<<" "<<amuon.calEnergy().em<<" "<<amuon.calEnergy().had<<" "<<amuon.calEnergy().ho;
00322   }
00323   
00324 
00325   //  Look up Compatibility by, where x is p and y the energy. 
00326   //  We have a set of different histograms for different regions of eta.
00327 
00328   // need error meassage in case the template histos are missing / the template file is not present!!! 070412
00329 
00330   if( pion_template_em )  { // access ecal background template
00331     if( accessing_overflow( pion_template_em, p, em ) ) {
00332       pbx = 1.;
00333       psx = 1.;
00334       LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for ecal - defaulting signal and background  ";
00335       LogTrace("MuonIdentification")<<"            // template value to 1. "<<pion_template_em->GetName()<<" e: "<<em<<" p: "<<p;
00336     }
00337     else pbx =  pion_template_em->GetBinContent(  pion_template_em->GetXaxis()->FindBin(p), pion_template_em->GetYaxis()->FindBin(em) );
00338   }
00339   if( pion_template_had ) { // access hcal background template
00340     if( accessing_overflow( pion_template_had, p, had ) ) {
00341       pby = 1.;
00342       psy = 1.;
00343       LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for hcal - defaulting signal and background  ";
00344       LogTrace("MuonIdentification")<<"            // template value to 1. "<<pion_template_had->GetName()<<" e: "<<had<<" p: "<<p;
00345     }
00346     else pby =  pion_template_had->GetBinContent(  pion_template_had->GetXaxis()->FindBin(p), pion_template_had->GetYaxis()->FindBin(had) );
00347   }
00348   if(pion_template_ho) { // access ho background template
00349     if( accessing_overflow( pion_template_ho, p, ho ) ) {
00350       pbz = 1.;
00351       psz = 1.;
00352       LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for ho   - defaulting signal and background  ";
00353       LogTrace("MuonIdentification")<<"            // template value to 1. "<<pion_template_ho->GetName()<<" e: "<<em<<" p: "<<p; 
00354     }
00355     else pbz =  pion_template_ho->GetBinContent(  pion_template_ho->GetXaxis()->FindBin(p), pion_template_ho->GetYaxis()->FindBin(ho) );
00356   }
00357 
00358 
00359   if( muon_template_em )  { // access ecal background template
00360     if( accessing_overflow( muon_template_em, p, em ) ) {
00361       psx = 1.;
00362       pbx = 1.;
00363       LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for ecal - defaulting signal and background  ";
00364       LogTrace("MuonIdentification")<<"            // template value to 1. "<<muon_template_em->GetName()<<" e: "<<em<<" p: "<<p;
00365     }
00366     else psx =  muon_template_em->GetBinContent(  muon_template_em->GetXaxis()->FindBin(p), muon_template_em->GetYaxis()->FindBin(em) );
00367   }
00368   if( muon_template_had ) { // access hcal background template
00369     if( accessing_overflow( muon_template_had, p, had ) ) {
00370       psy = 1.;
00371       pby = 1.;
00372       LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for hcal - defaulting signal and background  ";
00373       LogTrace("MuonIdentification")<<"            // template value to 1. "<<muon_template_had->GetName()<<" e: "<<had<<" p: "<<p;
00374     }
00375     else psy =  muon_template_had->GetBinContent(  muon_template_had->GetXaxis()->FindBin(p), muon_template_had->GetYaxis()->FindBin(had) );
00376   }
00377   if(muon_template_ho) { // access ho background template
00378     if( accessing_overflow( muon_template_ho, p, ho ) ) {
00379       psz = 1.;
00380       pbz = 1.;
00381        LogTrace("MuonIdentification")<<"            // Message: trying to access overflow bin in MuonCompatibility template for ho   - defaulting signal and background  ";
00382        LogTrace("MuonIdentification")<<"            // template value to 1. "<<muon_template_ho->GetName()<<" e: "<<ho<<" p: "<<p;
00383     }
00384     else psz =  muon_template_ho->GetBinContent(  muon_template_ho->GetXaxis()->FindBin(p), muon_template_ho->GetYaxis()->FindBin(ho) );
00385   }
00386 
00387   // erm - what is this?!?! How could the HO probability be less than 0????? Do we want this line!?!?
00388   if(psz <= 0.) psz = 1.;
00389   if(pbz <= 0.) pbz = 1.;
00390 
00391   // Protection agains empty bins - set cal part to neutral if the bin of the template is empty 
00392   // (temporary fix, a proper extrapolation would be better)
00393   if (psx == 0. || pbx == 0.) {
00394     psx = 1.;
00395     pbx = 1.;
00396   } 
00397   if (psy == 0. || pby == 0.) {
00398     psy = 1.;
00399     pby = 1.;
00400   } 
00401   if (psz == 0. || pbz == 0.) {
00402     psz = 1.;
00403     pbz = 1.;
00404   }
00405 
00406   // There are two classes of events that deliver 0 for the hcal or ho energy:
00407   // 1) the track momentum is so low that the extrapolation tells us it should not have reached the cal
00408   // 2) the crossed cell had an reading below the readout cuts.
00409   // The 2nd case discriminates between muons and hadrons, the 1st not. Thus for the time being, 
00410   // we set the returned ps and pb to 0 for these cases.
00411   // We need to have a return value different from 0 for the 1st case in the long run.
00412   if ( had == 0.0 ) {
00413     psy = 1.;
00414     pby = 1.;
00415   } 
00416   if ( ho == 0.0 ) {
00417     psz = 1.;
00418     pbz = 1.;
00419   }
00420   
00421 
00422   // Set em to neutral if no energy in em or negative energy measured. 
00423   // (These cases might indicate problems in the ecal association or readout?! The only 
00424   // hint so far: for critical eta region (eta in [1.52, 1.64]) have negative em values.)
00425   if( em <= 0. && !use_em_special ) {
00426     pbx = 1.;
00427     psx = 1.;
00428   }
00429 
00430   if( (psx*psy*psz+pbx*pby*pbz) > 0. ) muon_compatibility = psx*psy*psz / (psx*psy*psz+pbx*pby*pbz);
00431   else {
00432     LogTrace("MuonIdentification")<<"Divide by 0 - defaulting consistency to 0.5 (neutral)!!";
00433     muon_compatibility = 0.5;
00434     LogTrace("MuonIdentification")<<"Input variables: eta    p     em     had    ho "<<"\n"
00435              <<eta<<" "<<p<<" "<<em<<" "<<had<<" "<<ho<<" "<<"\n"
00436              <<"cal uncorr:    em     had    ho "<<"\n"
00437              <<eta<<" "<<p<<" "<<amuon.calEnergy().em<<" "<<amuon.calEnergy().had<<" "<<amuon.calEnergy().ho;
00438   }
00439   return muon_compatibility;
00440 }


Member Data Documentation

bool MuonCaloCompatibility::isConfigured_ [private]

Definition at line 34 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

double MuonCaloCompatibility::muon_compatibility [private]

Definition at line 83 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_em_etaB [private]

Definition at line 69 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_em_etaEmi [private]

Definition at line 73 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_em_etaEpl [private]

Definition at line 64 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_em_etaTmi [private]

Definition at line 71 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_em_etaTpl [private]

Definition at line 66 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_had_etaB [private]

Definition at line 68 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_had_etaEmi [private]

Definition at line 72 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_had_etaEpl [private]

Definition at line 63 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_had_etaTmi [private]

Definition at line 70 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_had_etaTpl [private]

Definition at line 65 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_ho_etaB [private]

Definition at line 67 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::muon_template_em [private]

Definition at line 47 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TH2D* MuonCaloCompatibility::muon_template_had [private]

Definition at line 48 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TH2D* MuonCaloCompatibility::muon_template_ho [private]

Definition at line 49 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TFile* MuonCaloCompatibility::muon_templates [private]

Definition at line 42 of file MuonCaloCompatibility.h.

Referenced by configure().

std::string MuonCaloCompatibility::MuonfileName_ [private]

Definition at line 38 of file MuonCaloCompatibility.h.

Referenced by configure().

double MuonCaloCompatibility::pbx [private]

Definition at line 75 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

double MuonCaloCompatibility::pby [private]

Definition at line 76 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

double MuonCaloCompatibility::pbz [private]

Definition at line 77 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_em_etaB [private]

Definition at line 57 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_em_etaEmi [private]

Definition at line 61 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_em_etaEpl [private]

Definition at line 52 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_em_etaTmi [private]

Definition at line 59 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_em_etaTpl [private]

Definition at line 54 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_had_etaB [private]

Definition at line 56 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_had_etaEmi [private]

Definition at line 60 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_had_etaEpl [private]

Definition at line 51 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_had_etaTmi [private]

Definition at line 58 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_had_etaTpl [private]

Definition at line 53 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_ho_etaB [private]

Definition at line 55 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

TH2D* MuonCaloCompatibility::pion_template_em [private]

Definition at line 44 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TH2D* MuonCaloCompatibility::pion_template_had [private]

Definition at line 45 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TH2D* MuonCaloCompatibility::pion_template_ho [private]

Definition at line 46 of file MuonCaloCompatibility.h.

Referenced by evaluate().

TFile* MuonCaloCompatibility::pion_templates [private]

Definition at line 41 of file MuonCaloCompatibility.h.

Referenced by configure().

std::string MuonCaloCompatibility::PionfileName_ [private]

Definition at line 39 of file MuonCaloCompatibility.h.

Referenced by configure().

double MuonCaloCompatibility::psx [private]

Definition at line 79 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

double MuonCaloCompatibility::psy [private]

Definition at line 80 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

double MuonCaloCompatibility::psz [private]

Definition at line 81 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

bool MuonCaloCompatibility::use_corrected_hcal [private]

Definition at line 85 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().

bool MuonCaloCompatibility::use_em_special [private]

Definition at line 86 of file MuonCaloCompatibility.h.

Referenced by configure(), and evaluate().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:40 2009 for CMSSW by  doxygen 1.5.4