00001 #ifndef CosMuoGenSource_h 00002 #define CosMuoGenSource_h 00003 // 00004 // CosmicMuonGenerator by droll (01/FEB/2006) 00005 // 00006 #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonGenerator.h" 00007 #include "HepMC/GenEvent.h" 00008 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" 00009 #include "FWCore/Framework/interface/GeneratedInputSource.h" 00010 #include "FWCore/Framework/interface/InputSourceDescription.h" 00011 #include "FWCore/Framework/interface/Event.h" 00012 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00013 #include "FWCore/Utilities/interface/Exception.h" 00014 00015 00016 namespace edm 00017 { 00018 class CosMuoGenSource : public GeneratedInputSource{ 00019 public: 00020 CosMuoGenSource(const ParameterSet&, const InputSourceDescription& ); 00021 virtual ~CosMuoGenSource(); 00022 00023 void endRun( Run& r); 00024 00025 private: 00026 virtual bool produce(Event & e); 00027 00028 void clear(); 00029 // define the configurable generator parameters 00030 int32_t RanS; // seed of random number generator (from Framework) 00031 double MinP; // min. P [GeV] 00032 double MinP_CMS; // min. P at CMS surface [GeV]; default is MinP_CMS=MinP, thus no bias from access-shaft 00033 double MaxP; // max. P [GeV] 00034 double MinT; // min. theta [deg] 00035 double MaxT; // max. theta [deg] 00036 double MinPh; // min. phi [deg] 00037 double MaxPh; // max. phi [deg] 00038 double MinS; // min. t0 [ns] 00039 double MaxS; // max. t0 [ns] 00040 double ELSF; // scale factor for energy loss 00041 double RTarget; // Radius of target-cylinder which cosmics HAVE to hit [mm], default is CMS-dimensions 00042 double ZTarget; // z-length of target-cylinder which cosmics HAVE to hit [mm], default is CMS-dimensions 00043 double ZCTarget; // z-position of centre of target-cylinder which cosmics HAVE to hit [mm], default is Nominal Interaction Point (=0) 00044 bool TrackerOnly; //if set to "true" detector with tracker-only setup is used, so no material or B-field outside is considerd 00045 bool MultiMuon; //read in multi-muon events from file instead of generating single muon events 00046 std::string MultiMuonFileName; //file containing multi muon events, to be read in 00047 int32_t MultiMuonFileFirstEvent; 00048 int32_t MultiMuonNmin; 00049 bool TIFOnly_constant; //if set to "true" cosmics can also be generated below 2GeV with unphysical constant energy dependence 00050 bool TIFOnly_linear; //if set to "true" cosmics can also be generated below 2GeV with unphysical linear energy dependence 00051 bool MTCCHalf; //if set to "true" muons are sure to hit half of CMS important for MTCC, 00052 //still material and B-field of whole CMS is considered 00053 00054 //Plug position (default = on shaft) 00055 double PlugVtx; 00056 double PlugVtz; 00057 00058 //material densities in g/cm^3 00059 double VarRhoAir; 00060 double VarRhoWall; 00061 double VarRhoRock; 00062 double VarRhoClay; 00063 double VarRhoPlug; 00064 double ClayLayerWidth; //[mm] 00065 00066 //For upgoing muon generation: Neutrino energy limits 00067 double MinEn; 00068 double MaxEn; 00069 double NuPrdAlt; 00070 00071 bool AllMu; //Accepting All Muons regardeless of direction 00072 00073 // external cross section and filter efficiency 00074 double extCrossSect; 00075 double extFilterEff; 00076 00077 00078 CosmicMuonGenerator* CosMuoGen; 00079 // the event format itself 00080 HepMC::GenEvent* fEvt; 00081 bool cmVerbosity_; 00082 }; 00083 } 00084 00085 #endif