CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Validation/HcalHits/interface/SimG4HcalValidation.h

Go to the documentation of this file.
00001 
00002 // File: SimG4HcalValidation.h
00003 // Analysis and validation of simhits of HCal inside the CMSSW framework
00005 #ifndef Validation_HcalHits_SimG4HcalValidation_H
00006 #define Validation_HcalHits_SimG4HcalValidation_H
00007 
00008 #include "SimG4Core/Watcher/interface/SimProducer.h"
00009 #include "SimG4Core/Notification/interface/Observer.h"
00010 
00011 #include "Validation/HcalHits/interface/SimG4HcalHitCluster.h"
00012 #include "Validation/HcalHits/interface/SimG4HcalHitJetFinder.h"
00013 #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"
00014 #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h"
00015 
00016 #include "SimDataFormats/CaloHit/interface/CaloHit.h"
00017 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
00018 
00019 #include <iostream>
00020 #include <memory>
00021 #include <vector>
00022 #include <string>
00023 
00024 class G4Step;
00025 class BeginOfJob;
00026 class BeginOfRun;
00027 class BeginOfEvent;
00028 class EndOfEvent;
00029 
00030 class SimG4HcalValidation : public SimProducer,
00031                             public Observer<const BeginOfJob *>, 
00032                             public Observer<const BeginOfRun *>, 
00033                             public Observer<const BeginOfEvent *>, 
00034                             public Observer<const EndOfEvent *>, 
00035                             public Observer<const G4Step *> {
00036 
00037 public:
00038   SimG4HcalValidation(const edm::ParameterSet &p);
00039   virtual ~SimG4HcalValidation();
00040 
00041   void produce(edm::Event&, const edm::EventSetup&);
00042 
00043 private:
00044   SimG4HcalValidation(const SimG4HcalValidation&); // stop default
00045   const SimG4HcalValidation& operator=(const SimG4HcalValidation&);
00046 
00047   void  init();
00048 
00049   // observer classes
00050   void update(const BeginOfJob * job);
00051   void update(const BeginOfRun * run);
00052   void update(const BeginOfEvent * evt);
00053   void update(const G4Step * step);
00054   void update(const EndOfEvent * evt);
00055 
00056   // jetfinding and analysis-related stuff
00057   void   fill(const EndOfEvent * ev);
00058   void   layerAnalysis(PHcalValidInfoLayer&);
00059   void   nxNAnalysis(PHcalValidInfoNxN&);
00060   void   jetAnalysis(PHcalValidInfoJets&);
00061   void   fetchHits(PHcalValidInfoLayer&);
00062   void   clear();
00063   void   collectEnergyRdir(const double, const double); 
00064   double getHcalScale(std::string, int) const; 
00065 
00066 
00067 private:
00068   //Keep parameters to instantiate Jet finder later 
00069   SimG4HcalHitJetFinder *   jetf;
00070 
00071   //Keep reference to instantiate HcalNumberingFromDDD later
00072   HcalNumberingFromDDD *    numberingFromDDD;
00073 
00074   //Keep parameters to instantiate HcalTestNumberingScheme later
00075   HcalTestNumberingScheme * org;
00076 
00077   // Hit cache for cluster analysis
00078   std::vector<CaloHit>      hitcache;   // e, eta, phi, time, layer, calo type 
00079 
00080   // scale factors :
00081   std::vector<float>        scaleHB;
00082   std::vector<float>        scaleHE;
00083   std::vector<float>        scaleHF;
00084   
00085   // to read from parameter set
00086   std::vector<std::string>  names;
00087   double                    coneSize, ehitThreshold, hhitThreshold;
00088   float                     timeLowlim, timeUplim, eta0, phi0, jetThreshold; 
00089   bool                      applySampling, hcalOnly;
00090   int                       infolevel;
00091   std::string               labelLayer, labelNxN, labelJets;
00092 
00093   // eta and phi size of windows around eta0, phi0
00094   std::vector<double>       dEta;
00095   std::vector<double>       dPhi;
00096 
00097   // some private members for ananlysis 
00098   unsigned int              count;                  
00099   double                    edepEB, edepEE, edepHB, edepHE, edepHO;
00100   double                    edepd[5], edepl[20];
00101   double                    een, hen, hoen; // Energy sum in ECAL, HCAL, HO 
00102   double                    vhitec, vhithc, enEcal, enHcal;
00103 };
00104 
00105 #endif