108 pythia =
new Pythia8::Pythia();
126 for (
size_t i = 0;
i <
pids.size(); ++
i) {
130 if (!pdt.isParticle(pid)) {
131 edm::LogError(
"TestPythiaDecays") <<
"ERROR: BAD PARTICLE, pythia is not aware of pid " << pid;
132 throw cms::Exception(
"Unknown",
"FastSim") <<
"Bad Particle Type " << pid <<
"\n";
138 double m0 = pd->m0();
139 double w = pd->mWidth();
142 mmin =
m0 -
m0 / 1000.;
143 mmax =
m0 +
m0 / 1000.;
148 std::stringstream strstr;
149 strstr <<
"mass_" << pid;
150 h_mass[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, mmin, mmax);
151 h_mass_ref[pid] = predict.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, mmin, mmax);
157 h_mass_ref[pid]->SetBinContent(
b, TMath::BreitWigner(_val, m0,
w));
163 strstr <<
"p_" << pid;
164 h_p[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 20);
168 strstr <<
"v_" << pid;
169 h_v[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 1.);
172 double ctau0 = pd->tau0() / 10.;
174 strstr <<
"plt_" << pid;
175 h_plt[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0,
std::min(5. * ctau0, 500.));
176 h_plt_ref[pid] = predict.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0,
std::min(5. * ctau0, 500.));
178 for (
int b = 1;
b <=
h_plt_ref[pid]->GetNbinsX(); ++
b) {
179 double _val =
h_plt_ref[pid]->GetBinCenter(
b);
180 h_plt_ref[pid]->SetBinContent(
b, TMath::Exp(-_val / ctau0));
185 strstr <<
"br_" << pid;
186 h_br[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 0, 0, 0);
187 h_br[pid]->SetCanExtend(TH1::kAllAxes);
188 h_br_ref[pid] = predict.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 0, 0, 0);
189 h_br_ref[pid]->SetCanExtend(TH1::kAllAxes);
192 for (
int d = 0;
d < pd->sizeChannels(); ++
d) {
193 Pythia8::DecayChannel& channel = pd->channel(
d);
194 std::vector<int>
prod;
195 for (
int p = 0;
p < channel.multiplicity(); ++
p) {
196 int pId =
abs(channel.product(
p));
199 (pId > 10 && pId != 12 && pId != 14 && pId != 16 && pId != 18 && pId != 21 && (pId < 23 || pId > 40) &&
200 (pId < 81 || pId > 100) && pId != 2101 && pId != 3101 && pId != 3201 && pId != 1103 && pId != 2103 &&
201 pId != 2203 && pId != 3103 && pId != 3203 && pId != 3303);
203 prod.push_back(
abs(channel.product(
p)));
207 for (
size_t p = 0;
p <
prod.size(); ++
p) {
208 strstr <<
"_" <<
prod[
p];
213 h_br[pid]->SetEntries(0);
219 strstr <<
"originVertexRho_" << pid;
220 h_originVertexRho[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 200);
222 strstr <<
"originVertexZ_" << pid;
223 h_originVertexZ[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 400);
225 strstr <<
"decayVertexRho_" << pid;
226 h_decayVertexRho[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 200);
228 strstr <<
"decayVertexZ_" << pid;
229 h_decayVertexZ[pid] = observe.
make<TH1D>(strstr.str().c_str(), strstr.str().c_str(), 100, 0, 400);
static const std::string kSharedResource
std::map< int, TH1D * > h_plt
T getParameter(std::string const &) const
std::map< int, TH1D * > h_originVertexRho
Log< level::Error, false > LogError
std::map< int, TH1D * > h_plt_ref
std::map< int, TH1D * > h_br_ref
std::map< int, TH1D * > h_br
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::map< int, TH1D * > h_originVertexZ
const edm::EDGetTokenT< std::vector< SimVertex > > tokVertex_
T * make(const Args &...args) const
make new ROOT object
std::map< int, TH1D * > h_p
std::map< int, TH1D * > h_mass
Abs< T >::type abs(const T &t)
HepPDT::ParticleData ParticleData
std::map< int, TH1D * > h_v
std::map< int, std::vector< std::string > > knownDecayModes
std::map< int, TH1D * > h_decayVertexZ
std::map< int, TH1D * > h_decayVertexRho
std::map< int, TH1D * > h_mass_ref
Pythia8::ParticleDataEntry * ParticleDataEntryPtr
const edm::EDGetTokenT< std::vector< SimTrack > > tokTrack_