9 #include "HepMC/GenEvent.h" 10 #include "HepMC/IO_HEPEVT.h" 11 #include "HepMC/HEPEVT_Wrapper.h" 17 #include "Photos/Photos.h" 18 #include "Photos/PhotosHepMCEvent.h" 24 fAvoidTauLeptonicDecays(
false),
25 fIsInitialized(
false),
29 bool UseHadronizerQEDBrem=
false;
31 std::vector<std::string> par =
fPSet->
getParameter< std::vector<std::string> >(
"parameterSets");
32 for (
unsigned int ip=0; ip<par.size(); ++ip ){
35 if(curSet==
"UseHadronizerQEDBrem") UseHadronizerQEDBrem=
true;
51 std::vector<std::string> par =
fPSet->
getParameter< std::vector<std::string> >(
"parameterSets");
52 for (
unsigned int ip=0; ip<par.size(); ++ip ){
56 if(curSet==
"maxWtInterference") Photospp::Photos::maxWtInterference(
fPSet->
getParameter<
double>(curSet));
57 if(curSet==
"setInfraredCutOff") Photospp::Photos::setInfraredCutOff(
fPSet->
getParameter<
double>(curSet));
58 if(curSet==
"setAlphaQED") Photospp::Photos::setAlphaQED(
fPSet->
getParameter<
double>(curSet));
59 if(curSet==
"setInterference") Photospp::Photos::setInterference(
fPSet->
getParameter<
bool>(curSet));
60 if(curSet==
"setDoubleBrem") Photospp::Photos::setDoubleBrem(
fPSet->
getParameter<
bool>(curSet));
61 if(curSet==
"setQuatroBrem") Photospp::Photos::setQuatroBrem(
fPSet->
getParameter<
bool>(curSet));
62 if(curSet==
"setExponentiation") Photospp::Photos::setExponentiation(
fPSet->
getParameter<
bool>(curSet));
63 if(curSet==
"setCorrectionWtForW") Photospp::Photos::setCorrectionWtForW(
fPSet->
getParameter<
bool>(curSet));
64 if(curSet==
"setMeCorrectionWtForScalar") Photospp::Photos::setMeCorrectionWtForScalar(
fPSet->
getParameter<
bool>(curSet));
65 if(curSet==
"setMeCorrectionWtForW") Photospp::Photos::setMeCorrectionWtForW(
fPSet->
getParameter<
bool>(curSet));
66 if(curSet==
"setMeCorrectionWtForZ") Photospp::Photos::setMeCorrectionWtForZ(
fPSet->
getParameter<
bool>(curSet));
67 if(curSet==
"initializeKinematicCorrections") Photospp::Photos::initializeKinematicCorrections(
fPSet->
getParameter<
int>(curSet));
68 if(curSet==
"forceMassFrom4Vector") Photospp::Photos::forceMassFrom4Vector(
fPSet->
getParameter<
bool>(curSet));
69 if(curSet==
"forceMassFromEventRecord") Photospp::Photos::forceMassFromEventRecord(
fPSet->
getParameter<
int>(curSet));
70 if(curSet==
"ignoreParticlesOfStatus") Photospp::Photos::ignoreParticlesOfStatus(
fPSet->
getParameter<
int>(curSet));
71 if(curSet==
"deIgnoreParticlesOfStatus") Photospp::Photos::deIgnoreParticlesOfStatus(
fPSet->
getParameter<
int>(curSet));
72 if(curSet==
"setMomentumConservationThreshold") Photospp::Photos::setMomentumConservationThreshold(
fPSet->
getParameter<
double>(curSet));
73 if(curSet==
"suppressAll")
if(
fPSet->
getParameter<
bool>(curSet)==
true)Photospp::Photos::suppressAll();
76 if(curSet==
"suppressBremForBranch"){
78 std::vector<std::string>
v = cfg.
getParameter<std::vector<std::string> >(
"parameterSets");
79 for(
unsigned int i=0;
i<v.size();
i++){
81 std::vector<int> vpar = cfg.
getParameter<std::vector<int> >(vs);
82 if(vpar.size()==1) Photospp::Photos::suppressBremForBranch(0,vpar[0]);
83 if(vpar.size()==2) Photospp::Photos::suppressBremForBranch(0,vpar[1]);
84 if(vpar.size()==3) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2]);
85 if(vpar.size()==4) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3]);
86 if(vpar.size()==5) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]);
87 if(vpar.size()==6) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]);
88 if(vpar.size()==7) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]);
89 if(vpar.size()==8) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]);
90 if(vpar.size()==9) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]);
91 if(vpar.size()==10) Photospp::Photos::suppressBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]);
94 if(curSet==
"suppressBremForDecay"){
96 std::vector<std::string>
v = cfg.
getParameter<std::vector<std::string> >(
"parameterSets");
97 for(
unsigned int i=0;
i<v.size();
i++){
99 std::vector<int> vpar = cfg.
getParameter<std::vector<int> >(vs);
100 if(vpar.size()==1) Photospp::Photos::suppressBremForDecay(0,vpar[0]);
101 if(vpar.size()==2) Photospp::Photos::suppressBremForDecay(0,vpar[1]);
102 if(vpar.size()==3) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2]);
103 if(vpar.size()==4) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3]);
104 if(vpar.size()==5) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]);
105 if(vpar.size()==6) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]);
106 if(vpar.size()==7) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]);
107 if(vpar.size()==8) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]);
108 if(vpar.size()==9) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]);
109 if(vpar.size()==10) Photospp::Photos::suppressBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]);
113 if(curSet==
"forceBremForBranch"){
115 std::vector<std::string>
v = cfg.
getParameter<std::vector<std::string> >(
"parameterSets");
116 for(
unsigned int i=0;
i<v.size();
i++){
118 std::vector<int> vpar = cfg.
getParameter<std::vector<int> >(vs);
119 if(vpar.size()==1) Photospp::Photos::forceBremForBranch(0,vpar[0]);
120 if(vpar.size()==2) Photospp::Photos::forceBremForBranch(0,vpar[1]);
121 if(vpar.size()==3) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2]);
122 if(vpar.size()==4) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3]);
123 if(vpar.size()==5) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]);
124 if(vpar.size()==6) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]);
125 if(vpar.size()==7) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]);
126 if(vpar.size()==8) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]);
127 if(vpar.size()==9) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]);
128 if(vpar.size()==10) Photospp::Photos::forceBremForBranch(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]);
131 if(curSet==
"forceBremForDecay"){
133 std::vector<std::string>
v = cfg.
getParameter<std::vector<std::string> >(
"parameterSets");
134 for(
unsigned int i=0;
i<v.size();
i++){
136 std::vector<int> vpar = cfg.
getParameter<std::vector<int> >(vs);
137 if(vpar.size()==1) Photospp::Photos::forceBremForDecay(0,vpar[0]);
138 if(vpar.size()==2) Photospp::Photos::forceBremForDecay(0,vpar[1]);
139 if(vpar.size()==3) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2]);
140 if(vpar.size()==4) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3]);
141 if(vpar.size()==5) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4]);
142 if(vpar.size()==6) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5]);
143 if(vpar.size()==7) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6]);
144 if(vpar.size()==8) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7]);
145 if(vpar.size()==9) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8]);
146 if(vpar.size()==10) Photospp::Photos::forceBremForDecay(vpar[0],vpar[1],vpar[2],vpar[3],vpar[4],vpar[5],vpar[6],vpar[7],vpar[8],vpar[9]);
150 if(curSet==
"forceMass"){
152 std::vector<std::string>
v = cfg.
getParameter<std::vector<std::string> >(
"parameterSets");
153 for(
unsigned int i=0;
i<v.size();
i++){
155 std::vector<double> vpar = cfg.
getParameter<std::vector<double> >(vs);
156 if(vpar.size()==2) Photospp::Photos::forceMass((
int)vpar[0], vpar[1]);
162 Photospp::Photos::suppressAll();
163 Photospp::Photos::forceBremForBranch(0,
fOnlyPDG);
164 Photospp::Photos::forceBremForBranch(0,-1*
fOnlyPDG);
167 Photospp::Photos::suppressBremForDecay(3, 15, 16, 11, -12);
168 Photospp::Photos::suppressBremForDecay(3, -15, -16, -11, 12);
169 Photospp::Photos::suppressBremForDecay(3, 15, 16, 13, -14);
170 Photospp::Photos::suppressBremForDecay(3, -15, -16, -13, -14);
172 Photospp::Photos::iniInfo();
180 int NPartBefore = evt->particles_size();
181 Photospp::PhotosHepMCEvent PhotosEvt(evt);
184 for (HepMC::GenEvent::vertex_const_iterator
vtx=evt->vertices_begin();
vtx!=evt->vertices_end();
vtx++ ){
185 std::vector<int> BCodes;
189 if((*pitr)->barcode()>10000){
190 BCodes.push_back((*pitr)->barcode());
194 if(BCodes.size() > 0){
195 for(
size_t ibc=0; ibc<BCodes.size(); ibc++){
197 int nbc = p1->barcode() - 10000 + NPartBefore;
198 p1->suggest_barcode(nbc);
208 <<
"PhotosppInterface::flat: Attempt to generate random number when engine pointer is null\n" 209 <<
"This might mean that the code was modified to generate a random number outside the\n" 210 <<
"event and beginLuminosityBlock methods, which is not allowed.\n";
T getParameter(std::string const &) const
static AlgebraicMatrix initialize()
void setRandomEngine(CLHEP::HepRandomEngine *decayRandomEngine)
static CLHEP::HepRandomEngine * fRandomEngine
CLHEP::HepRandomEngine * decayRandomEngine
PhotosppInterface(const edm::ParameterSet &pset)
edm::ParameterSet * fPSet
HepMC::GenEvent * apply(HepMC::GenEvent *)
void configureOnlyFor(int)
bool fAvoidTauLeptonicDecays
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::string > fSpecialSettings