CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HcalSimHitsValidation Class Reference

#include <HcalSimHitsValidation.h>

Inheritance diagram for HcalSimHitsValidation:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (edm::Event const &ev, edm::EventSetup const &c)
virtual void beginJob ()
virtual void endJob ()
 HcalSimHitsValidation (edm::ParameterSet const &conf)
 ~HcalSimHitsValidation ()

Private Member Functions

double dPhiWsign (double phi1, double phi2)
double dR (double eta1, double phi1, double eta2, double phi2)
double phi12 (double phi1, double en1, double phi2, double en2)

Private Attributes

std::vector< int > cdepth
std::vector< double > cen
std::vector< double > ceta
std::vector< int > cieta
std::vector< int > ciphi
std::vector< double > cphi
std::vector< int > csub
std::vector< double > ctime
std::vector< double > cz
DQMStoredbe_
MonitorElemente_hb
MonitorElemente_he
MonitorElemente_hfl
MonitorElemente_hfs
MonitorElemente_ho
std::string ecalselector_
MonitorElementemap_HB1
MonitorElementemap_HB2
MonitorElementemap_HE1
MonitorElementemap_HE2
MonitorElementemap_HE3
MonitorElementemap_HF1
MonitorElementemap_HF2
MonitorElementemap_HO
double emap_min [82][72][4][4]
MonitorElementemean_seqHB1
MonitorElementemean_seqHB2
MonitorElementemean_seqHE1
MonitorElementemean_seqHE2
MonitorElementemean_seqHE3
MonitorElementemean_seqHF1
MonitorElementemean_seqHF2
MonitorElementemean_seqHO
MonitorElementemean_vs_ieta_HB1
MonitorElementemean_vs_ieta_HB2
MonitorElementemean_vs_ieta_HE1
MonitorElementemean_vs_ieta_HE2
MonitorElementemean_vs_ieta_HE3
MonitorElementemean_vs_ieta_HF1
MonitorElementemean_vs_ieta_HF2
MonitorElementemean_vs_ieta_HO
int etype_
std::string eventype_
bool famos_
edm::ESHandle< CaloGeometrygeometry
std::string hcalselector_
int imc
int iz
MonitorElementmap_depth1
MonitorElementmap_depth2
MonitorElementmap_depth3
MonitorElementmap_depth4
MonitorElementmap_ecal
MonitorElementmap_econe_depth1
MonitorElementmap_econe_depth2
MonitorElementmap_econe_depth3
MonitorElementmap_econe_depth4
std::string mc_
MonitorElementmeDeltaEta
MonitorElementmeDeltaEtaS
MonitorElementmeDeltaPhi
MonitorElementmeDeltaPhiS
MonitorElementmeEcalHcalEnergyConeHB
MonitorElementmeEcalHcalEnergyConeHE
MonitorElementmeEcalHcalEnergyConeHF
MonitorElementmeEcalHcalEnergyConeHO
MonitorElementmeEcalHcalEnergyHB
MonitorElementmeEcalHcalEnergyHE
MonitorElementmeEnConeEtaProfile
MonitorElementmeEnConeEtaProfile_depth1
MonitorElementmeEnConeEtaProfile_depth2
MonitorElementmeEnConeEtaProfile_depth3
MonitorElementmeEnConeEtaProfile_depth4
MonitorElementmeEnConeEtaProfile_E
MonitorElementmeEnConeEtaProfile_EH
MonitorElementmeEnergyHcalVsEcalHB
MonitorElementmeEnergyHcalVsEcalHE
MonitorElementmeNumEcalRecHitsConeHB
MonitorElementmeNumEcalRecHitsConeHE
MonitorElementmeNumRecHitsConeHB
MonitorElementmeNumRecHitsConeHE
MonitorElementmeNumRecHitsConeHF
MonitorElementmeNumRecHitsConeHO
MonitorElementmeNumRecHitsThreshHB
MonitorElementmeNumRecHitsThreshHE
MonitorElementmeNumRecHitsThreshHO
MonitorElementmeRecHitSimHitHB
MonitorElementmeRecHitSimHitHE
MonitorElementmeRecHitSimHitHF
MonitorElementmeRecHitSimHitHFL
MonitorElementmeRecHitSimHitHFS
MonitorElementmeRecHitSimHitHO
MonitorElementmeRecHitSimHitProfileHB
MonitorElementmeRecHitSimHitProfileHE
MonitorElementmeRecHitSimHitProfileHF
MonitorElementmeRecHitSimHitProfileHFL
MonitorElementmeRecHitSimHitProfileHFS
MonitorElementmeRecHitSimHitProfileHO
MonitorElementmeSimHitsEnergyHB
MonitorElementmeSimHitsEnergyHE
MonitorElementmeSimHitsEnergyHF
MonitorElementmeSimHitsEnergyHO
MonitorElementmeSumRecHitsEnergyConeHB
MonitorElementmeSumRecHitsEnergyConeHE
MonitorElementmeSumRecHitsEnergyConeHF
MonitorElementmeSumRecHitsEnergyConeHFL
MonitorElementmeSumRecHitsEnergyConeHFS
MonitorElementmeSumRecHitsEnergyConeHO
MonitorElementmeSumRecHitsEnergyHB
MonitorElementmeSumRecHitsEnergyHE
MonitorElementmeSumRecHitsEnergyHF
MonitorElementmeSumRecHitsEnergyHO
MonitorElementmeTE_HB
MonitorElementmeTE_HB1
MonitorElementmeTE_HB2
MonitorElementmeTE_HE
MonitorElementmeTE_HE1
MonitorElementmeTE_HE2
MonitorElementmeTE_HF
MonitorElementmeTE_HFL
MonitorElementmeTE_HFS
MonitorElementmeTE_HO
MonitorElementmeTEprofileHB
MonitorElementmeTEprofileHE
MonitorElementmeTEprofileHF
MonitorElementmeTEprofileHO
MonitorElementmeTimeHB
MonitorElementmeTimeHE
MonitorElementmeTimeHF
MonitorElementmeTimeHO
int nevtot
MonitorElementNhb
MonitorElementNhe
MonitorElementNhf
MonitorElementNho
MonitorElementoccupancy_map_HB1
MonitorElementoccupancy_map_HB2
MonitorElementoccupancy_map_HE1
MonitorElementoccupancy_map_HE2
MonitorElementoccupancy_map_HE3
MonitorElementoccupancy_map_HF1
MonitorElementoccupancy_map_HF2
MonitorElementoccupancy_map_HO
MonitorElementoccupancy_seqHB1
MonitorElementoccupancy_seqHB2
MonitorElementoccupancy_seqHE1
MonitorElementoccupancy_seqHE2
MonitorElementoccupancy_seqHE3
MonitorElementoccupancy_seqHF1
MonitorElementoccupancy_seqHF2
MonitorElementoccupancy_seqHO
MonitorElementoccupancy_vs_ieta_HB1
MonitorElementoccupancy_vs_ieta_HB2
MonitorElementoccupancy_vs_ieta_HE1
MonitorElementoccupancy_vs_ieta_HE2
MonitorElementoccupancy_vs_ieta_HE3
MonitorElementoccupancy_vs_ieta_HF1
MonitorElementoccupancy_vs_ieta_HF2
MonitorElementoccupancy_vs_ieta_HO
std::string outputFile_
MonitorElementRMS_seq_HB1
MonitorElementRMS_seq_HB2
MonitorElementRMS_seq_HE1
MonitorElementRMS_seq_HE2
MonitorElementRMS_seq_HE3
MonitorElementRMS_seq_HF1
MonitorElementRMS_seq_HF2
MonitorElementRMS_seq_HO
MonitorElementRMS_vs_ieta_HB1
MonitorElementRMS_vs_ieta_HB2
MonitorElementRMS_vs_ieta_HE1
MonitorElementRMS_vs_ieta_HE2
MonitorElementRMS_vs_ieta_HE3
MonitorElementRMS_vs_ieta_HF1
MonitorElementRMS_vs_ieta_HF2
MonitorElementRMS_vs_ieta_HO
std::string sign_
int subdet_
MonitorElementZS_HB1
MonitorElementZS_HB2
MonitorElementZS_HE1
MonitorElementZS_HE2
MonitorElementZS_HE3
MonitorElementZS_HF1
MonitorElementZS_HF2
MonitorElementZS_HO
MonitorElementZS_nHB1
MonitorElementZS_nHB2
MonitorElementZS_nHE1
MonitorElementZS_nHE2
MonitorElementZS_nHE3
MonitorElementZS_nHF1
MonitorElementZS_nHF2
MonitorElementZS_nHO
MonitorElementZS_seqHB1
MonitorElementZS_seqHB2
MonitorElementZS_seqHE1
MonitorElementZS_seqHE2
MonitorElementZS_seqHE3
MonitorElementZS_seqHF1
MonitorElementZS_seqHF2
MonitorElementZS_seqHO

Detailed Description

Definition at line 43 of file HcalSimHitsValidation.h.


Constructor & Destructor Documentation

HcalSimHitsValidation::HcalSimHitsValidation ( edm::ParameterSet const &  conf)

Definition at line 5 of file HcalSimHitsValidation.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), dbe_, emean_vs_ieta_HB1, emean_vs_ieta_HB2, emean_vs_ieta_HE1, emean_vs_ieta_HE2, emean_vs_ieta_HE3, emean_vs_ieta_HF1, emean_vs_ieta_HF2, emean_vs_ieta_HO, edm::ParameterSet::getUntrackedParameter(), trackerHits::histo, meEnConeEtaProfile, meEnConeEtaProfile_E, meEnConeEtaProfile_EH, meSimHitsEnergyHB, meSimHitsEnergyHE, meSimHitsEnergyHF, meSimHitsEnergyHO, nevtot, Nhb, Nhe, Nhf, Nho, occupancy_vs_ieta_HB1, occupancy_vs_ieta_HB2, occupancy_vs_ieta_HE1, occupancy_vs_ieta_HE2, occupancy_vs_ieta_HE3, occupancy_vs_ieta_HF1, occupancy_vs_ieta_HF2, occupancy_vs_ieta_HO, cmsCodeRules::cppFunctionSkipper::operator, outputFile_, and DQMStore::setCurrentFolder().

                                                                        {
  // DQM ROOT output
  outputFile_ = conf.getUntrackedParameter<std::string>("outputFile", "myfile.root");
  
  if ( outputFile_.size() != 0 ) {    edm::LogInfo("OutputInfo") << " Hcal SimHit Task histograms will be saved to '" << outputFile_.c_str() << "'";
  } else {
    edm::LogInfo("OutputInfo") << " Hcal SimHit Task histograms will NOT be saved";
  }
  
  nevtot = 0;
  
  dbe_ = 0;
  // get hold of back-end interface
  dbe_ = edm::Service<DQMStore>().operator->();
   
  Char_t histo[200];

  if ( dbe_ ) {
    dbe_->setCurrentFolder("HcalSimHitsV/HcalSimHitTask");

    // General counters
    sprintf  (histo, "N_HB" );
    Nhb = dbe_->book1D(histo, histo, 2600,0.,2600.);
    sprintf  (histo, "N_HE" );
    Nhe = dbe_->book1D(histo, histo, 2600,0.,2600.);
    sprintf  (histo, "N_HO" );
    Nho = dbe_->book1D(histo, histo, 2200,0.,2200.);
    sprintf  (histo, "N_HF" );
    Nhf = dbe_->book1D(histo, histo, 1800,0., 1800.);

    //Mean energy vs iEta TProfiles
    sprintf  (histo, "emean_vs_ieta_HB1" );
    emean_vs_ieta_HB1 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s");
    sprintf  (histo, "emean_vs_ieta_HB2" );
    emean_vs_ieta_HB2 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s");
    sprintf  (histo, "emean_vs_ieta_HE1" );
    emean_vs_ieta_HE1 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10. ,2000., "s" );
    sprintf  (histo, "emean_vs_ieta_HE2" );
    emean_vs_ieta_HE2 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s");
    sprintf  (histo, "emean_vs_ieta_HE3" );
    emean_vs_ieta_HE3 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s" );
    sprintf  (histo, "emean_vs_ieta_HO" );
    emean_vs_ieta_HO = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s" );
    sprintf  (histo, "emean_vs_ieta_HF1" );
    emean_vs_ieta_HF1 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s" );
    sprintf  (histo, "emean_vs_ieta_HF2" );
    emean_vs_ieta_HF2 = dbe_->bookProfile(histo, histo, 82, -41., 41., 2010, -10., 2000., "s" );

    //Occupancy vs. iEta TH1Fs
    sprintf  (histo, "occupancy_vs_ieta_HB1" );
    occupancy_vs_ieta_HB1 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HB2" );
    occupancy_vs_ieta_HB2 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HE1" );
    occupancy_vs_ieta_HE1 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HE2" );
    occupancy_vs_ieta_HE2 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HE3" );
    occupancy_vs_ieta_HE3 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HO" );
    occupancy_vs_ieta_HO = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HF1" );
    occupancy_vs_ieta_HF1 = dbe_->book1D(histo, histo, 82, -41., 41.);
    sprintf  (histo, "occupancy_vs_ieta_HF2" );
    occupancy_vs_ieta_HF2 = dbe_->book1D(histo, histo, 82, -41., 41.);

    //Energy spectra
    sprintf (histo, "HcalSimHitTask_energy_of_simhits_HB" ) ;
    meSimHitsEnergyHB = dbe_->book1D(histo, histo, 510 , -0.1 , 5.); 

    sprintf (histo, "HcalSimHitTask_energy_of_simhits_HE" ) ;
    meSimHitsEnergyHE = dbe_->book1D(histo, histo, 510, -0.02, 2.); 

    sprintf (histo, "HcalSimHitTask_energy_of_simhits_HO" ) ;
    meSimHitsEnergyHO = dbe_->book1D(histo, histo, 510 , -0.1 , 5.); 
    
    sprintf (histo, "HcalSimHitTask_energy_of_simhits_HF" ) ;
    meSimHitsEnergyHF = dbe_->book1D(histo, histo, 1010 , -5. , 500.); 

    //Energy in Cone
    sprintf (histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths");
    meEnConeEtaProfile = dbe_->bookProfile(histo, histo, 82, -41., 41., 210, -10., 200.);  
    
    sprintf (histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_E");
    meEnConeEtaProfile_E = dbe_->bookProfile(histo, histo, 82, -41., 41., 210, -10., 200.);  
      
    sprintf (histo, "HcalSimHitTask_En_simhits_cone_profile_vs_ieta_all_depths_EH");
    meEnConeEtaProfile_EH = dbe_->bookProfile(histo, histo, 82, -41., 41., 210, -10., 200.);  
    
   }  //end-of if(_dbe) 

}
HcalSimHitsValidation::~HcalSimHitsValidation ( )

Definition at line 99 of file HcalSimHitsValidation.cc.

{ }

Member Function Documentation

void HcalSimHitsValidation::analyze ( edm::Event const &  ev,
edm::EventSetup const &  c 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 157 of file HcalSimHitsValidation.cc.

References gather_cfg::cout, dR(), emean_vs_ieta_HB1, emean_vs_ieta_HB2, emean_vs_ieta_HE1, emean_vs_ieta_HE2, emean_vs_ieta_HE3, emean_vs_ieta_HF1, emean_vs_ieta_HF2, emean_vs_ieta_HO, ExpressReco_HICollisions_FallBack::etaMax, MonitorElement::Fill(), geometry, edm::EventSetup::get(), edm::Event::getByLabel(), meEnConeEtaProfile, meEnConeEtaProfile_E, meEnConeEtaProfile_EH, meSimHitsEnergyHB, meSimHitsEnergyHE, meSimHitsEnergyHF, meSimHitsEnergyHO, nevtot, npart, occupancy_vs_ieta_HB1, occupancy_vs_ieta_HB2, occupancy_vs_ieta_HE1, occupancy_vs_ieta_HE2, occupancy_vs_ieta_HE3, occupancy_vs_ieta_HF1, occupancy_vs_ieta_HF2, occupancy_vs_ieta_HO, L1TEmulatorMonitor_cff::p, ExpressReco_HICollisions_FallBack::pt, and csvReporter::r.

                                                                              {

  using namespace edm;
  using namespace std;

  //===========================================================================
  // Getting SimHits
  //===========================================================================

  double phi_MC = -999.;  // phi of initial particle from HepMC
  double eta_MC = -999.;  // eta of initial particle from HepMC

  edm::Handle<edm::HepMCProduct> evtMC;
  //  ev.getByLabel("VtxSmeared",evtMC);
  ev.getByLabel("generator",evtMC);  // generator in late 310_preX
  if (!evtMC.isValid()) {
    std::cout << "no HepMCProduct found" << std::endl;    
  }

  // MC particle with highest pt is taken as a direction reference  
  double maxPt = -99999.;
  int npart    = 0;

  const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
        p != myGenEvent->particles_end(); ++p ) {
    double phip = (*p)->momentum().phi();
    double etap = (*p)->momentum().eta();
    double pt   = (*p)->momentum().perp();
    if(pt > maxPt) {npart++; maxPt = pt; phi_MC = phip; eta_MC = etap; }
  }

  double partR   = 0.3;


  //Hcal SimHits

  //Approximate calibration constants
  const float calib_HB = 120.;
  const float calib_HE = 190.;
  const float calib_HF1 = 1.0/0.383;
  const float calib_HF2 = 1.0/0.368;
  
  edm::Handle<PCaloHitContainer> hcalHits;
  ev.getByLabel("g4SimHits","HcalHits",hcalHits);
  const PCaloHitContainer * SimHitResult = hcalHits.product () ;
    
  float eta_diff;
  float etaMax  = 9999;
  int ietaMax = 0;

  double HcalCone = 0;

  c.get<CaloGeometryRecord>().get (geometry);
    
  for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
    HcalDetId cell(SimHits->id());
    const CaloCellGeometry* cellGeometry = geometry->getSubdetectorGeometry (cell)->getGeometry (cell);
    double etaS = cellGeometry->getPosition().eta () ;
    double phiS = cellGeometry->getPosition().phi () ;
    double en   = SimHits->energy();    
    
    int sub     = cell.subdet();
    int depth   = cell.depth();
    double ieta = cell.ieta();

    //Energy in Cone 
    double r  = dR(eta_MC, phi_MC, etaS, phiS);
    
    if (r < partR){      
      eta_diff = fabs(eta_MC - etaS);
      if(eta_diff < etaMax) {
        etaMax  = eta_diff; 
        ietaMax = cell.ieta(); 
      }
      //Approximation of calibration
      if      (sub == 1)               HcalCone += en*calib_HB;
      else if (sub == 2)               HcalCone += en*calib_HE;
      else if (sub == 4 && depth == 1) HcalCone += en*calib_HF1;
      else if (sub == 4 && depth == 2) HcalCone += en*calib_HF2;
    }
    
    //Account for lack of ieta = 0
    if (ieta > 0) ieta--;

    //HB
    if (sub == 1){
      meSimHitsEnergyHB->Fill(en);
      if (depth == 1){
        emean_vs_ieta_HB1->Fill(double(ieta), en);
        occupancy_vs_ieta_HB1->Fill(double(ieta));
      }
      if (depth == 2){
        emean_vs_ieta_HB2->Fill(double(ieta), en);
        occupancy_vs_ieta_HB2->Fill(double(ieta));
      }
    }
    //HE
    if (sub == 2){
      meSimHitsEnergyHE->Fill(en);
      if (depth == 1){
        emean_vs_ieta_HE1->Fill(double(ieta), en);
        occupancy_vs_ieta_HE1->Fill(double(ieta));
      }
      if (depth == 2){
        emean_vs_ieta_HE2->Fill(double(ieta), en);
        occupancy_vs_ieta_HE2->Fill(double(ieta));
      }
      if (depth == 3){
        emean_vs_ieta_HE3->Fill(double(ieta), en);
        occupancy_vs_ieta_HE3->Fill(double(ieta));
      }
    }
    //HO
    if (sub == 3){
      meSimHitsEnergyHO->Fill(en);
      emean_vs_ieta_HO->Fill(double(ieta), en);
      occupancy_vs_ieta_HO->Fill(double(ieta));
    }
    //HF
    if (sub == 4){
      meSimHitsEnergyHF->Fill(en);
      if (depth == 1){
        emean_vs_ieta_HF1->Fill(double(ieta), en);
        occupancy_vs_ieta_HF1->Fill(double(ieta));
      }
      if (depth == 2){
        emean_vs_ieta_HF2->Fill(double(ieta), en);
        occupancy_vs_ieta_HF2->Fill(double(ieta));
      }
    }     
  }

  //Ecal EB SimHits
  edm::Handle<PCaloHitContainer> ecalEBHits;
  ev.getByLabel("g4SimHits","EcalHitsEB",ecalEBHits);
  const PCaloHitContainer * SimHitResultEB = ecalEBHits.product () ;

  double EcalCone = 0;

  for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEB->begin () ; SimHits != SimHitResultEB->end(); ++SimHits) {

    EBDetId EBid = EBDetId(SimHits->id());

    const CaloCellGeometry* cellGeometry = geometry->getSubdetectorGeometry (EBid)->getGeometry (EBid) ;
    double etaS = cellGeometry->getPosition().eta () ;
    double phiS = cellGeometry->getPosition().phi () ;
    double en   = SimHits->energy();    
  
    double r  = dR(eta_MC, phi_MC, etaS, phiS);
    
    if (r < partR) EcalCone += en;   
  }

  //Ecal EE SimHits
  edm::Handle<PCaloHitContainer> ecalEEHits;
  ev.getByLabel("g4SimHits","EcalHitsEE",ecalEEHits);
  const PCaloHitContainer * SimHitResultEE = ecalEEHits.product () ;

  for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResultEE->begin () ; SimHits != SimHitResultEE->end(); ++SimHits) {

    EEDetId EEid = EEDetId(SimHits->id());

    const CaloCellGeometry* cellGeometry = geometry->getSubdetectorGeometry (EEid)->getGeometry (EEid) ;
    double etaS = cellGeometry->getPosition().eta () ;
    double phiS = cellGeometry->getPosition().phi () ;
    double en   = SimHits->energy();    
    
    double r  = dR(eta_MC, phi_MC, etaS, phiS);
    
    if (r < partR) EcalCone += en;   
  }

  if (ietaMax != 0){            //If ietaMax == 0, there were no good HCAL SimHits 
    if (ietaMax > 0) ietaMax--; //Account for lack of ieta = 0
    
    meEnConeEtaProfile       ->Fill(double(ietaMax), HcalCone);    
    meEnConeEtaProfile_E     ->Fill(double(ietaMax), EcalCone);
    meEnConeEtaProfile_EH    ->Fill(double(ietaMax), HcalCone+EcalCone); 
  }
  
  nevtot++;
}
void HcalSimHitsValidation::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 155 of file HcalSimHitsValidation.cc.

{ }
double HcalSimHitsValidation::dPhiWsign ( double  phi1,
double  phi2 
) [private]

Definition at line 368 of file HcalSimHitsValidation.cc.

References PI, and tmp.

                                                                {
  // clockwise      phi2 w.r.t phi1 means "+" phi distance
  // anti-clockwise phi2 w.r.t phi1 means "-" phi distance 

  double PI = 3.1415926535898;
  double a1 = phi1; double a2  = phi2;
  double tmp =  a2 - a1;
  if( a1*a2 < 0.) {
    if(a1 > 0.5 * PI)  tmp += 2.*PI;
    if(a2 > 0.5 * PI)  tmp -= 2.*PI;
  }
  return tmp;

}
double HcalSimHitsValidation::dR ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
) [private]

Definition at line 342 of file HcalSimHitsValidation.cc.

References PI, mathSSE::sqrt(), and tmp.

Referenced by analyze().

                                                                                   { 
  double PI = 3.1415926535898;
  double deltaphi= phi1 - phi2;
  if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
  if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
  double deltaeta = eta2 - eta1;
  double tmp = sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
  return tmp;
}
void HcalSimHitsValidation::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 101 of file HcalSimHitsValidation.cc.

References dbe_, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, nevtot, occupancy_vs_ieta_HB1, occupancy_vs_ieta_HB2, occupancy_vs_ieta_HE1, occupancy_vs_ieta_HE2, occupancy_vs_ieta_HE3, occupancy_vs_ieta_HF1, occupancy_vs_ieta_HF2, occupancy_vs_ieta_HO, outputFile_, DQMStore::save(), and MonitorElement::setBinContent().

                                   { 
  //before check that histos are there....

  // check if ME still there (and not killed by MEtoEDM for memory saving)
  if( dbe_ )
    {
      // check existence of first histo in the list
      if (! dbe_->get("HcalSimHitsV/HcalSimHitTask/N_HB")) return;
    }
  else
    return;
  
  //======================================

  for (int i = 1; i <= occupancy_vs_ieta_HB1->getNbinsX(); i++){

    int ieta = i - 42;        // -41 -1, 0 40 
    if(ieta >=0 ) ieta +=1;   // -41 -1, 1 41  - to make it detector-like

    float phi_factor;

    if      (fabs(ieta) <= 20) phi_factor = 72.;
    else if (fabs(ieta) <  40) phi_factor = 36.;
    else                       phi_factor = 18.;
    
    float cnorm;

    //Occupancy vs. iEta TH1Fs
    cnorm = occupancy_vs_ieta_HB1->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HB1->setBinContent(i, cnorm);
    cnorm = occupancy_vs_ieta_HB2->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HB2->setBinContent(i, cnorm);

    cnorm = occupancy_vs_ieta_HE1->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HE1->setBinContent(i, cnorm);
    cnorm = occupancy_vs_ieta_HE2->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HE2->setBinContent(i, cnorm);
    cnorm = occupancy_vs_ieta_HE3->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HE3->setBinContent(i, cnorm);

    cnorm = occupancy_vs_ieta_HO->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HO->setBinContent(i, cnorm);

    cnorm = occupancy_vs_ieta_HF1->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HF1->setBinContent(i, cnorm);
    cnorm = occupancy_vs_ieta_HF2->getBinContent(i) / (phi_factor * nevtot); 
    occupancy_vs_ieta_HF2->setBinContent(i, cnorm);
  }


  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
}
double HcalSimHitsValidation::phi12 ( double  phi1,
double  en1,
double  phi2,
double  en2 
) [private]

Definition at line 352 of file HcalSimHitsValidation.cc.

References PI, and tmp.

                                                                                    {
  // weighted mean value of phi1 and phi2
  
  double tmp;
  double PI = 3.1415926535898;
  double a1 = phi1; double a2  = phi2;

  if( a1 > 0.5*PI  && a2 < 0.) a2 += 2*PI; 
  if( a2 > 0.5*PI  && a1 < 0.) a1 += 2*PI; 
  tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
  if(tmp > PI) tmp -= 2.*PI; 
 
  return tmp;

}

Member Data Documentation

std::vector<int> HcalSimHitsValidation::cdepth [private]

Definition at line 311 of file HcalSimHitsValidation.h.

std::vector<double> HcalSimHitsValidation::cen [private]

Definition at line 312 of file HcalSimHitsValidation.h.

std::vector<double> HcalSimHitsValidation::ceta [private]

Definition at line 313 of file HcalSimHitsValidation.h.

std::vector<int> HcalSimHitsValidation::cieta [private]

Definition at line 309 of file HcalSimHitsValidation.h.

std::vector<int> HcalSimHitsValidation::ciphi [private]

Definition at line 310 of file HcalSimHitsValidation.h.

std::vector<double> HcalSimHitsValidation::cphi [private]

Definition at line 314 of file HcalSimHitsValidation.h.

std::vector<int> HcalSimHitsValidation::csub [private]

Definition at line 308 of file HcalSimHitsValidation.h.

std::vector<double> HcalSimHitsValidation::ctime [private]

Definition at line 315 of file HcalSimHitsValidation.h.

std::vector<double> HcalSimHitsValidation::cz [private]

Definition at line 316 of file HcalSimHitsValidation.h.

Definition at line 56 of file HcalSimHitsValidation.h.

Referenced by endJob(), and HcalSimHitsValidation().

Definition at line 215 of file HcalSimHitsValidation.h.

Definition at line 216 of file HcalSimHitsValidation.h.

Definition at line 218 of file HcalSimHitsValidation.h.

Definition at line 219 of file HcalSimHitsValidation.h.

Definition at line 217 of file HcalSimHitsValidation.h.

std::string HcalSimHitsValidation::ecalselector_ [private]

Definition at line 60 of file HcalSimHitsValidation.h.

Definition at line 121 of file HcalSimHitsValidation.h.

Definition at line 122 of file HcalSimHitsValidation.h.

Definition at line 123 of file HcalSimHitsValidation.h.

Definition at line 124 of file HcalSimHitsValidation.h.

Definition at line 125 of file HcalSimHitsValidation.h.

Definition at line 127 of file HcalSimHitsValidation.h.

Definition at line 128 of file HcalSimHitsValidation.h.

Definition at line 126 of file HcalSimHitsValidation.h.

double HcalSimHitsValidation::emap_min[82][72][4][4] [private]

Definition at line 319 of file HcalSimHitsValidation.h.

Definition at line 148 of file HcalSimHitsValidation.h.

Definition at line 149 of file HcalSimHitsValidation.h.

Definition at line 150 of file HcalSimHitsValidation.h.

Definition at line 151 of file HcalSimHitsValidation.h.

Definition at line 152 of file HcalSimHitsValidation.h.

Definition at line 154 of file HcalSimHitsValidation.h.

Definition at line 155 of file HcalSimHitsValidation.h.

Definition at line 153 of file HcalSimHitsValidation.h.

Definition at line 130 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 131 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 132 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 133 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 134 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 136 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 137 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 135 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 70 of file HcalSimHitsValidation.h.

std::string HcalSimHitsValidation::eventype_ [private]

Definition at line 61 of file HcalSimHitsValidation.h.

Definition at line 64 of file HcalSimHitsValidation.h.

Definition at line 305 of file HcalSimHitsValidation.h.

Referenced by analyze().

std::string HcalSimHitsValidation::hcalselector_ [private]

Definition at line 59 of file HcalSimHitsValidation.h.

Definition at line 72 of file HcalSimHitsValidation.h.

Definition at line 71 of file HcalSimHitsValidation.h.

Definition at line 82 of file HcalSimHitsValidation.h.

Definition at line 83 of file HcalSimHitsValidation.h.

Definition at line 84 of file HcalSimHitsValidation.h.

Definition at line 85 of file HcalSimHitsValidation.h.

Definition at line 119 of file HcalSimHitsValidation.h.

Definition at line 195 of file HcalSimHitsValidation.h.

Definition at line 196 of file HcalSimHitsValidation.h.

Definition at line 197 of file HcalSimHitsValidation.h.

Definition at line 198 of file HcalSimHitsValidation.h.

std::string HcalSimHitsValidation::mc_ [private]

Definition at line 63 of file HcalSimHitsValidation.h.

Definition at line 210 of file HcalSimHitsValidation.h.

Definition at line 212 of file HcalSimHitsValidation.h.

Definition at line 209 of file HcalSimHitsValidation.h.

Definition at line 211 of file HcalSimHitsValidation.h.

Definition at line 277 of file HcalSimHitsValidation.h.

Definition at line 278 of file HcalSimHitsValidation.h.

Definition at line 280 of file HcalSimHitsValidation.h.

Definition at line 279 of file HcalSimHitsValidation.h.

Definition at line 274 of file HcalSimHitsValidation.h.

Definition at line 275 of file HcalSimHitsValidation.h.

Definition at line 205 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 201 of file HcalSimHitsValidation.h.

Definition at line 202 of file HcalSimHitsValidation.h.

Definition at line 203 of file HcalSimHitsValidation.h.

Definition at line 204 of file HcalSimHitsValidation.h.

Definition at line 206 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 207 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 298 of file HcalSimHitsValidation.h.

Definition at line 299 of file HcalSimHitsValidation.h.

Definition at line 302 of file HcalSimHitsValidation.h.

Definition at line 303 of file HcalSimHitsValidation.h.

Definition at line 227 of file HcalSimHitsValidation.h.

Definition at line 228 of file HcalSimHitsValidation.h.

Definition at line 230 of file HcalSimHitsValidation.h.

Definition at line 229 of file HcalSimHitsValidation.h.

Definition at line 222 of file HcalSimHitsValidation.h.

Definition at line 223 of file HcalSimHitsValidation.h.

Definition at line 224 of file HcalSimHitsValidation.h.

Definition at line 283 of file HcalSimHitsValidation.h.

Definition at line 284 of file HcalSimHitsValidation.h.

Definition at line 286 of file HcalSimHitsValidation.h.

Definition at line 287 of file HcalSimHitsValidation.h.

Definition at line 288 of file HcalSimHitsValidation.h.

Definition at line 285 of file HcalSimHitsValidation.h.

Definition at line 290 of file HcalSimHitsValidation.h.

Definition at line 291 of file HcalSimHitsValidation.h.

Definition at line 293 of file HcalSimHitsValidation.h.

Definition at line 294 of file HcalSimHitsValidation.h.

Definition at line 295 of file HcalSimHitsValidation.h.

Definition at line 292 of file HcalSimHitsValidation.h.

Definition at line 239 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 240 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 242 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 241 of file HcalSimHitsValidation.h.

Referenced by analyze(), and HcalSimHitsValidation().

Definition at line 266 of file HcalSimHitsValidation.h.

Definition at line 267 of file HcalSimHitsValidation.h.

Definition at line 269 of file HcalSimHitsValidation.h.

Definition at line 270 of file HcalSimHitsValidation.h.

Definition at line 271 of file HcalSimHitsValidation.h.

Definition at line 268 of file HcalSimHitsValidation.h.

Definition at line 260 of file HcalSimHitsValidation.h.

Definition at line 261 of file HcalSimHitsValidation.h.

Definition at line 263 of file HcalSimHitsValidation.h.

Definition at line 262 of file HcalSimHitsValidation.h.

Definition at line 244 of file HcalSimHitsValidation.h.

Definition at line 245 of file HcalSimHitsValidation.h.

Definition at line 246 of file HcalSimHitsValidation.h.

Definition at line 248 of file HcalSimHitsValidation.h.

Definition at line 249 of file HcalSimHitsValidation.h.

Definition at line 250 of file HcalSimHitsValidation.h.

Definition at line 254 of file HcalSimHitsValidation.h.

Definition at line 255 of file HcalSimHitsValidation.h.

Definition at line 256 of file HcalSimHitsValidation.h.

Definition at line 252 of file HcalSimHitsValidation.h.

Definition at line 247 of file HcalSimHitsValidation.h.

Definition at line 251 of file HcalSimHitsValidation.h.

Definition at line 257 of file HcalSimHitsValidation.h.

Definition at line 253 of file HcalSimHitsValidation.h.

Definition at line 233 of file HcalSimHitsValidation.h.

Definition at line 234 of file HcalSimHitsValidation.h.

Definition at line 236 of file HcalSimHitsValidation.h.

Definition at line 235 of file HcalSimHitsValidation.h.

Definition at line 322 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 75 of file HcalSimHitsValidation.h.

Referenced by HcalSimHitsValidation().

Definition at line 76 of file HcalSimHitsValidation.h.

Referenced by HcalSimHitsValidation().

Definition at line 78 of file HcalSimHitsValidation.h.

Referenced by HcalSimHitsValidation().

Definition at line 77 of file HcalSimHitsValidation.h.

Referenced by HcalSimHitsValidation().

Definition at line 166 of file HcalSimHitsValidation.h.

Definition at line 167 of file HcalSimHitsValidation.h.

Definition at line 168 of file HcalSimHitsValidation.h.

Definition at line 169 of file HcalSimHitsValidation.h.

Definition at line 170 of file HcalSimHitsValidation.h.

Definition at line 172 of file HcalSimHitsValidation.h.

Definition at line 173 of file HcalSimHitsValidation.h.

Definition at line 171 of file HcalSimHitsValidation.h.

Definition at line 184 of file HcalSimHitsValidation.h.

Definition at line 185 of file HcalSimHitsValidation.h.

Definition at line 186 of file HcalSimHitsValidation.h.

Definition at line 187 of file HcalSimHitsValidation.h.

Definition at line 188 of file HcalSimHitsValidation.h.

Definition at line 190 of file HcalSimHitsValidation.h.

Definition at line 191 of file HcalSimHitsValidation.h.

Definition at line 189 of file HcalSimHitsValidation.h.

Definition at line 175 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 176 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 177 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 178 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 179 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 181 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 182 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

Definition at line 180 of file HcalSimHitsValidation.h.

Referenced by analyze(), endJob(), and HcalSimHitsValidation().

std::string HcalSimHitsValidation::outputFile_ [private]

Definition at line 58 of file HcalSimHitsValidation.h.

Referenced by endJob(), and HcalSimHitsValidation().

Definition at line 157 of file HcalSimHitsValidation.h.

Definition at line 158 of file HcalSimHitsValidation.h.

Definition at line 159 of file HcalSimHitsValidation.h.

Definition at line 160 of file HcalSimHitsValidation.h.

Definition at line 161 of file HcalSimHitsValidation.h.

Definition at line 163 of file HcalSimHitsValidation.h.

Definition at line 164 of file HcalSimHitsValidation.h.

Definition at line 162 of file HcalSimHitsValidation.h.

Definition at line 139 of file HcalSimHitsValidation.h.

Definition at line 140 of file HcalSimHitsValidation.h.

Definition at line 141 of file HcalSimHitsValidation.h.

Definition at line 142 of file HcalSimHitsValidation.h.

Definition at line 143 of file HcalSimHitsValidation.h.

Definition at line 145 of file HcalSimHitsValidation.h.

Definition at line 146 of file HcalSimHitsValidation.h.

Definition at line 144 of file HcalSimHitsValidation.h.

std::string HcalSimHitsValidation::sign_ [private]

Definition at line 62 of file HcalSimHitsValidation.h.

Definition at line 67 of file HcalSimHitsValidation.h.

Definition at line 87 of file HcalSimHitsValidation.h.

Definition at line 88 of file HcalSimHitsValidation.h.

Definition at line 89 of file HcalSimHitsValidation.h.

Definition at line 90 of file HcalSimHitsValidation.h.

Definition at line 91 of file HcalSimHitsValidation.h.

Definition at line 93 of file HcalSimHitsValidation.h.

Definition at line 94 of file HcalSimHitsValidation.h.

Definition at line 92 of file HcalSimHitsValidation.h.

Definition at line 96 of file HcalSimHitsValidation.h.

Definition at line 97 of file HcalSimHitsValidation.h.

Definition at line 98 of file HcalSimHitsValidation.h.

Definition at line 99 of file HcalSimHitsValidation.h.

Definition at line 100 of file HcalSimHitsValidation.h.

Definition at line 102 of file HcalSimHitsValidation.h.

Definition at line 103 of file HcalSimHitsValidation.h.

Definition at line 101 of file HcalSimHitsValidation.h.

Definition at line 105 of file HcalSimHitsValidation.h.

Definition at line 106 of file HcalSimHitsValidation.h.

Definition at line 107 of file HcalSimHitsValidation.h.

Definition at line 108 of file HcalSimHitsValidation.h.

Definition at line 109 of file HcalSimHitsValidation.h.

Definition at line 111 of file HcalSimHitsValidation.h.

Definition at line 112 of file HcalSimHitsValidation.h.

Definition at line 110 of file HcalSimHitsValidation.h.