Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:27

0001 #ifndef CosMuoGenProducer_h
0002 #define CosMuoGenProducer_h
0003 //
0004 // CosmicMuonProducer by droll (01/FEB/2006)
0005 //
0006 #include "HepMC/GenEvent.h"
0007 
0008 #include "FWCore/Framework/interface/one/EDProducer.h"
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/LuminosityBlock.h"
0012 #include "FWCore/Framework/interface/Run.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/Utilities/interface/Exception.h"
0015 
0016 #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonGenerator.h"
0017 
0018 #include <memory>
0019 
0020 namespace edm {
0021   class CosMuoGenProducer : public one::EDProducer<EndRunProducer, one::WatchLuminosityBlocks> {
0022   public:
0023     CosMuoGenProducer(const ParameterSet&);
0024     ~CosMuoGenProducer() override;
0025 
0026   private:
0027     void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) override;
0028     void endLuminosityBlock(LuminosityBlock const&, EventSetup const&) override {}
0029 
0030     void produce(Event& e, const EventSetup& es) override;
0031 
0032     void endRunProduce(Run& r, const EventSetup& es) override;
0033 
0034     void clear();
0035     // define the configurable generator parameters
0036     int32_t RanS;     // seed of random number generator (from Framework)
0037     double MinP;      // min. P     [GeV]
0038     double MinP_CMS;  // min. P at CMS surface    [GeV]; default is MinP_CMS=MinP, thus no bias from access-shaft
0039     double MaxP;      // max. P     [GeV]
0040     double MinT;      // min. theta [deg]
0041     double MaxT;      // max. theta [deg]
0042     double MinPh;     // min. phi   [deg]
0043     double MaxPh;     // max. phi   [deg]
0044     double MinS;      // min. t0    [ns]
0045     double MaxS;      // max. t0    [ns]
0046     double ELSF;      // scale factor for energy loss
0047     double RTarget;   // Radius of target-cylinder which cosmics HAVE to hit [mm], default is CMS-dimensions
0048     double ZTarget;   // z-length of target-cylinder which cosmics HAVE to hit [mm], default is CMS-dimensions
0049     double
0050         ZCTarget;  // z-position of centre of target-cylinder which cosmics HAVE to hit [mm], default is Nominal Interaction Point
0051     bool TrackerOnly;  //if set to "true" detector with tracker-only setup is used, so no material or B-field outside is considerd
0052     bool MultiMuon;                 //read in multi-muon events from file instead of generating single muon events
0053     std::string MultiMuonFileName;  //file containing multi muon events, to be read in
0054     int32_t MultiMuonFileFirstEvent;
0055     int32_t MultiMuonNmin;
0056     bool TIFOnly_constant;  //if set to "true" cosmics can also be generated below 2GeV with unphysical constant energy dependence
0057     bool TIFOnly_linear;  //if set to "true" cosmics can also be generated below 2GeV with unphysical linear energy dependence
0058     bool MTCCHalf;        //if set to "true" muons are sure to hit half of CMS important for MTCC,
0059                           //still material and B-field of whole CMS is considered
0060 
0061     //Plug position (default = on shaft)
0062     double PlugVtx;
0063     double PlugVtz;
0064 
0065     //material densities in g/cm^3
0066     double VarRhoAir;
0067     double VarRhoWall;
0068     double VarRhoRock;
0069     double VarRhoClay;
0070     double VarRhoPlug;
0071     double ClayLayerWidth;  //[mm]
0072 
0073     //For upgoing muon generation: Neutrino energy limits
0074     double MinEn;
0075     double MaxEn;
0076     double NuPrdAlt;
0077 
0078     bool AllMu;  //Accepting All Muons regardeless of direction
0079 
0080     // external cross section and filter efficiency
0081     double extCrossSect;
0082     double extFilterEff;
0083 
0084     std::unique_ptr<CosmicMuonGenerator> CosMuoGen;
0085     // the event format itself
0086     bool cmVerbosity_;
0087 
0088     bool isInitialized_;
0089   };
0090 }  // namespace edm
0091 
0092 #endif