15 MinP(pset.getParameter<double>(
"MinP")),
16 MinP_CMS(pset.getParameter<double>(
"MinP_CMS")),
17 MaxP(pset.getParameter<double>(
"MaxP")),
18 MinT(pset.getParameter<double>(
"MinTheta")),
19 MaxT(pset.getParameter<double>(
"MaxTheta")),
20 MinPh(pset.getParameter<double>(
"MinPhi")),
21 MaxPh(pset.getParameter<double>(
"MaxPhi")),
22 MinS(pset.getParameter<double>(
"MinT0")),
23 MaxS(pset.getParameter<double>(
"MaxT0")),
24 ELSF(pset.getParameter<double>(
"ElossScaleFactor")),
25 RTarget(pset.getParameter<double>(
"RadiusOfTarget")),
26 ZTarget(pset.getParameter<double>(
"ZDistOfTarget")),
27 ZCTarget(pset.getParameter<double>(
"ZCentrOfTarget")),
28 TrackerOnly(pset.getParameter<bool>(
"TrackerOnly")),
29 MultiMuon(pset.getParameter<bool>(
"MultiMuon")),
30 MultiMuonFileName(pset.getParameter<std::string>(
"MultiMuonFileName")),
31 MultiMuonFileFirstEvent(pset.getParameter<int>(
"MultiMuonFileFirstEvent")),
32 MultiMuonNmin(pset.getParameter<int>(
"MultiMuonNmin")),
33 TIFOnly_constant(pset.getParameter<bool>(
"TIFOnly_constant")),
34 TIFOnly_linear(pset.getParameter<bool>(
"TIFOnly_linear")),
35 MTCCHalf(pset.getParameter<bool>(
"MTCCHalf")),
36 PlugVtx(pset.getParameter<double>(
"PlugVx")),
37 PlugVtz(pset.getParameter<double>(
"PlugVz")),
38 VarRhoAir(pset.getParameter<double>(
"RhoAir")),
39 VarRhoWall(pset.getParameter<double>(
"RhoWall")),
40 VarRhoRock(pset.getParameter<double>(
"RhoRock")),
41 VarRhoClay(pset.getParameter<double>(
"RhoClay")),
42 VarRhoPlug(pset.getParameter<double>(
"RhoPlug")),
43 ClayLayerWidth(pset.getParameter<double>(
"ClayWidth")),
44 MinEn(pset.getParameter<double>(
"MinEnu")),
45 MaxEn(pset.getParameter<double>(
"MaxEnu")),
46 NuPrdAlt(pset.getParameter<double>(
"NuProdAlt")),
47 AllMu(pset.getParameter<bool>(
"AcptAllMu")),
48 extCrossSect(pset.getUntrackedParameter<double>(
"crossSection", -1.)),
49 extFilterEff(pset.getUntrackedParameter<double>(
"filterEfficiency", -1.)),
50 cmVerbosity_(pset.getParameter<bool>(
"Verbosity"))
97 produces<HepMCProduct>();
99 produces<GenRunInfoProduct, edm::InRun>();
114 double cs = CosMuoGen->getRate();
115 genRunInfo->setInternalXSec(cs);
116 genRunInfo->setExternalXSecLO(extCrossSect);
117 genRunInfo->setFilterEfficiency(extFilterEff);
121 CosMuoGen->terminate();
131 CosMuoGen->nextEvent();
134 bool success = CosMuoGen->nextMultiEvent();
135 if (!success)
return false;
139 std::cout <<
"CosMuoGenSource.cc: CosMuoGen->EventWeight=" << CosMuoGen->EventWeight
140 <<
" CosMuoGen: Nmuons=" << CosMuoGen->Id_sf.size() << std::endl;
141 std::cout <<
"CosMuoGen->Id_at=" << CosMuoGen->Id_at
142 <<
" CosMuoGen->Vx_at=" << CosMuoGen->Vx_at
143 <<
" CosMuoGen->Vy_at=" << CosMuoGen->Vy_at
144 <<
" CosMuoGen->Vz_at=" << CosMuoGen->Vz_at
145 <<
" CosMuoGen->T0_at=" << CosMuoGen->T0_at << std::endl;
147 <<
" Py=" << CosMuoGen->Py_at
148 <<
" Pz=" << CosMuoGen->Pz_at << std::endl;
149 for (
unsigned int i=0;
i<CosMuoGen->Id_sf.size(); ++
i) {
150 std::cout <<
"Id_sf[" <<
i <<
"]=" << CosMuoGen->Id_sf[
i]
151 <<
" Vx_sf[" <<
i <<
"]=" << CosMuoGen->Vx_sf[
i]
152 <<
" Vy_sf=" << CosMuoGen->Vy_sf[
i]
153 <<
" Vz_sf=" << CosMuoGen->Vz_sf[
i]
154 <<
" T0_sf=" << CosMuoGen->T0_sf[
i]
155 <<
" Px_sf=" << CosMuoGen->Px_sf[
i]
156 <<
" Py_sf=" << CosMuoGen->Py_sf[
i]
157 <<
" Pz_sf=" << CosMuoGen->Pz_sf[
i] << std::endl;
158 std::cout <<
"phi_sf=" << atan2(CosMuoGen->Px_sf[
i],CosMuoGen->Pz_sf[
i]) << std::endl;
159 std::cout <<
"Id_ug[" <<
i <<
"]=" << CosMuoGen->Id_ug[
i]
160 <<
" Vx_ug[" <<
i <<
"]=" << CosMuoGen->Vx_ug[
i]
161 <<
" Vy_ug=" << CosMuoGen->Vy_ug[
i]
162 <<
" Vz_ug=" << CosMuoGen->Vz_ug[
i]
163 <<
" T0_ug=" << CosMuoGen->T0_ug[
i]
164 <<
" Px_ug=" << CosMuoGen->Px_ug[
i]
165 <<
" Py_ug=" << CosMuoGen->Py_ug[
i]
166 <<
" Pz_ug=" << CosMuoGen->Pz_ug[
i] << std::endl;
167 std::cout <<
"phi_ug=" << atan2(CosMuoGen->Px_ug[
i],CosMuoGen->Pz_ug[
i]) << std::endl;;
172 fEvt =
new HepMC::GenEvent();
174 HepMC::GenVertex* Vtx_at =
new HepMC::GenVertex(HepMC::FourVector(CosMuoGen->Vx_at,
179 HepMC::FourVector p_at(CosMuoGen->Px_at,CosMuoGen->Py_at,CosMuoGen->Pz_at,CosMuoGen->E_at);
182 Vtx_at->add_particle_in(Part_at);
186 for (
unsigned int i=0;
i<CosMuoGen->Id_sf.size(); ++
i) {
188 HepMC::FourVector p_sf(CosMuoGen->Px_sf[
i],CosMuoGen->Py_sf[
i],CosMuoGen->Pz_sf[
i],CosMuoGen->E_sf[
i]);
191 Vtx_at->add_particle_out(Part_sf_in);
193 HepMC::GenVertex* Vtx_sf =
new HepMC::GenVertex(HepMC::FourVector(CosMuoGen->Vx_sf[
i], CosMuoGen->Vy_sf[
i], CosMuoGen->Vz_sf[
i], CosMuoGen->T0_sf[
i]));
197 Vtx_sf->add_particle_in(Part_sf_in);
198 Vtx_sf->add_particle_out(Part_sf_out);
200 fEvt->add_vertex(Vtx_sf);
202 HepMC::GenVertex* Vtx_ug =
new HepMC::GenVertex(HepMC::FourVector(CosMuoGen->Vx_ug[
i], CosMuoGen->Vy_ug[
i], CosMuoGen->Vz_ug[
i], CosMuoGen->T0_ug[
i]));
204 HepMC::FourVector p_ug(CosMuoGen->Px_ug[
i],CosMuoGen->Py_ug[
i],CosMuoGen->Pz_ug[
i],CosMuoGen->E_ug[
i]);
208 Vtx_ug->add_particle_in(Part_sf_out);
209 Vtx_ug->add_particle_out(Part_ug);
211 fEvt->add_vertex(Vtx_ug);
215 fEvt->add_vertex(Vtx_at);
216 fEvt->set_signal_process_vertex(Vtx_at);
218 fEvt->set_event_number(
event());
219 fEvt->set_signal_process_id(13);
221 fEvt->weights().push_back( CosMuoGen->EventWeight );
222 fEvt->weights().push_back( CosMuoGen->Trials );
225 if (cmVerbosity_) fEvt->print();
227 std::auto_ptr<HepMCProduct> CMProduct(
new HepMCProduct());
228 CMProduct->addHepMCData( fEvt );
void setZDistOfTarget(double Z)
int32_t MultiMuonFileFirstEvent
void initialize(CLHEP::HepRandomEngine *rng=0)
void setMinEnu(double MinEn)
auto_ptr< ClusterSequence > cs
void setTIFOnly_constant(bool TIF)
void setNuProdAlt(double NuPrdAlt)
void setZCentrOfTarget(double Z)
std::string MultiMuonFileName
void setRhoAir(double VarRhoAir)
void setRadiusOfTarget(double R)
void setNumberOfEvents(unsigned int N)
virtual bool produce(Event &e)
void setMultiMuonFileFirstEvent(int MultiMuFile1stEvt)
void setRhoPlug(double VarRhoPlug)
void setMinPhi(double Phi)
void setMaxPhi(double Phi)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
void setMultiMuonNmin(int MultiMuNmin)
CosMuoGenSource(const ParameterSet &, const InputSourceDescription &)
void setMinTheta(double Theta)
void setMaxEnu(double MaxEn)
void setMultiMuon(bool MultiMu)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void setClayWidth(double ClayLaeyrWidth)
CosmicMuonGenerator * CosMuoGen
void setAcptAllMu(bool AllMu)
void setPlugVz(double PlugVtz)
void setTIFOnly_linear(bool TIF)
virtual ~CosMuoGenSource()
void setMultiMuonFileName(std::string MultiMuonFileName)
void setMTCCHalf(bool MTCC)
void setMinP_CMS(double P)
void setElossScaleFactor(double ElossScaleFact)
void setMaxTheta(double Theta)
void put(std::auto_ptr< PROD > product)
Put a new product.
void setRhoWall(double VarRhoSWall)
void setPlugVx(double PlugVtx)
void setRhoRock(double VarRhoRock)
virtual uint32_t mySeed() const =0
Exists for backward compatibility.
void setRhoClay(double VarRhoClay)
void setTrackerOnly(bool Tracker)