FairRoot/PandaRoot
Typedefs | Functions | Variables
toy_core.C File Reference
#include "EventShape.h"
#include "SimpleNtp.C"
#include <iostream>
#include <vector>
#include <map>
#include "TFile.h"
#include "TTree.h"
#include "TRandom3.h"
#include "TDatabasePDG.h"
#include "TParticlePDG.h"
#include "TCanvas.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TLegend.h"
#include "TParticle.h"
#include "TClonesArray.h"
#include "TF1.h"
#include "TStyle.h"
#include "TNtuple.h"
#include "TLatex.h"
#include "TGaxis.h"

Go to the source code of this file.

Typedefs

typedef std::vector< SimpleCandCandList
 

Functions

void setStyle ()
 
void boostList (CandList &list, CandList &boostlist, TVector3 boost)
 
bool isFinalState (int n)
 
double dponline (TLorentzVector &v)
 
void makePidTable (double pideff, double misid)
 
void init (double pideff, double misid)
 
void printCand (SimpleCand c)
 
void printList (CandList &l, TString tit="")
 
void printAllLists ()
 
int massCrit (CandList &l, double m, double w)
 
bool eventAccepted (CandList &l, double m=0, double w=0)
 
int fillHisto (CandList &l, TH1 *hall, TH1 *hbg=0, double m=0, double w=0, TH1 *hallsel=0, TH1 *hbgsel=0, TH1 *hsig=0, TH1 *hmm=0, TH2 *hmvsmm=0)
 
int combine (CandList &l1, CandList &l2, CandList &out, int matchPdg=0)
 
int combine (CandList &l1, CandList &l2, CandList &l3, CandList &out, int matchPdg=0)
 
int combine (CandList &l1, CandList &l2, CandList &l3, CandList &l4, CandList &out, int matchPdg=0)
 
void smearMom (SimpleCand &c, double dpr=0.05, double dtht=0.000, double dphi=0.000)
 
bool isDetected (double eff=0.90)
 
void makeRecoCands (CandList &mc, CandList &reco, double eff=0.90, double dp=0.05, double dtht=0.001, double dphi=0.001)
 
void selectMass (CandList &in, CandList &out, double mmean=0, double mw=0)
 
void select (CandList &in, CandList &out, int chrg=0, int pdg=0, double mass=0.139)
 
void makePidSelection (CandList &l)
 
void makeIni4Vector (TLorentzVector &l, double s)
 
void configHisto (TH1 *h)
 
void qaCand (TString pre, SimpleCand &c, SimpleNtp *n)
 
void writeTuple (TString pre, CandList &l, EventShape &evsh, SimpleNtp *n, double mass, double win)
 
int toy_core (TString fsig, int nev=2, double sqrts=3.77, bool simcut=true, bool evcut=false, double dp=0.05, double trkeff=95., double pideff=95., double misid=5., double P_mix=0.00, bool writentp=false, int mode=9999)
 

Variables

TRandom3 fRand
 
TLorentzVector fIni
 
const int fMAX = 100
 
int nbins = 300
 
double low = 0.0
 
double high = 6.0
 
const double fNeutEff = 0.95
 
const double fdE = 0.05
 
const double fNdtht = 0.003
 
const double fNdphi = 0.003
 
int nsigpiks = 5
 
int nsig = 8
 
int fPi0Pdg = 111
 
double fPi0Mass = 0.13497
 
double fPi0win = 0
 
double fPi0sig = 0.0055
 
int fKsPdg = 310
 
double fKsMass = 0.497614
 
double fKswin = 0.025
 
double fKssig = 0.012
 
int fDPdg = 411
 
double fDMass = 1.8693
 
double fDsig = 0.045
 
double fDwin =0.25
 
int fD0Pdg = 421
 
double fD0Mass = 1.8645
 
double fD0sig = 0.055
 
double fD0win =0.25
 
int fJpsiPdg = 443
 
double fJMass = 3.09687
 
double fJsig = 0.11
 
double fJwin =0.7
 
int feePdg = 88880
 
double feeMass = 0
 
double feesigconst = 0.0024
 
double feesigslope = 0.036
 
double feewin = 0.
 
int fLamPdg = 3122
 
double fLamMass = 1.115684
 
double fLamsig = 0.0042
 
double fLamwin =0.1
 
int fDsPdg = 431
 
double fDsMass = 1.9686
 
double fDssig = 0.04
 
double fDswin =0.2
 
int fPhiPdg = 333
 
double fPhiMass = 1.0195
 
double fPhisig = 0.0065
 
double fPhiwin =0.2
 
int fEtacPdg = 441
 
double fEtacMass = 2.9798
 
double fEtacsig = 0.08
 
double fEtacwin =0.15
 
int fLamcPdg = 4122
 
double fLamcMass = 2.2849
 
double fLamcsig = 0.035
 
double fLamcwin =0.2
 
double pidtab [25]
 
double pidreal [25]
 
double mE
 
double mMu
 
double mPi
 
double mK
 
double mP
 
double mPi0
 
TF1 * f_res =0
 
int npi
 
int nk
 
int npr
 
int ne
 
int nmu
 
int nlep
 
int evtno
 
int globmode
 
std::map< int, int > pdgidx
 
TDatabasePDG * pdg_db
 
CandList mclist
 
CandList mcFSlist
 
CandList recolist
 
CandList recocmslist
 
CandList eplus
 
CandList eminus
 
CandList muplus
 
CandList muminus
 
CandList piplus
 
CandList piminus
 
CandList kplus
 
CandList kminus
 
CandList pplus
 
CandList pminus
 
CandList gam
 

Typedef Documentation

typedef std::vector<SimpleCand> CandList

Definition at line 132 of file toy_core.C.

Function Documentation

void boostList ( CandList list,
CandList boostlist,
TVector3  boost 
)

Definition at line 164 of file toy_core.C.

References c, i, SimpleCand::P4(), and SimpleCand::SetP4().

Referenced by toy_core().

165 {
166  int N=list.size();
167  boostlist.clear();
168 
169  for (unsigned int i=0;i<N;i++)
170  {
171  SimpleCand c=list[i];
172  TLorentzVector lv(c.P4());
173  lv.Boost(-boost);
174  c.SetP4(lv);
175  boostlist.push_back(c);
176  }
177 }
void SetP4(TLorentzVector lv)
Definition: SimpleCand.C:20
Int_t i
Definition: run_full.C:25
TLorentzVector P4() const
Definition: SimpleCand.C:39
int combine ( CandList l1,
CandList l2,
CandList out,
int  matchPdg = 0 
)

Definition at line 363 of file toy_core.C.

References SimpleCand::AddDau(), c, i, m2(), mclist, SimpleCand::SetCharge(), SimpleCand::SetEvtId(), SimpleCand::SetId(), SimpleCand::SetMarker(), SimpleCand::SetMcPid(), SimpleCand::SetMct(), SimpleCand::SetMotherIdx(), SimpleCand::SetNFS(), SimpleCand::SetP4(), and SimpleCand::SetPdg().

Referenced by toy_core().

364 {
365  out.clear();
366 
367  bool sameList = (&l1 == &l2);
368 
369  for (unsigned int i=0;i<l1.size();++i)
370  {
371  for (unsigned int j=0;j<l2.size();++j)
372  {
373  if (sameList && j<=i) continue;
374  if (l1[i].Marker() & l2[j].Marker()) continue; // *** overlap
375  //if (l1[i].EvtId()!=l2[j].EvtId()) continue; // *** tracks from different events
376  SimpleCand c;
377  c.SetP4(l1[i].P4()+l2[j].P4());
378  c.SetCharge(l1[i].Charge()+l2[j].Charge());
379  c.SetNFS(l1[i].NFS()+l2[j].NFS());
380  c.SetMarker(l1[i].Marker() | l2[j].Marker());
381  c.AddDau(&(l1[i]));c.AddDau(&(l2[j]));
382  c.SetPdg(matchPdg);
383 
384  int m1 = l1[i].MotherIdx();
385  int m2 = l2[j].MotherIdx();
386  int ev1 = l1[i].EvtId();
387  int ev2 = l2[j].EvtId();
388 
389  if ( ev1==ev2 && // *** particles are from same event
390  m1>=0 && m1 == m2 && // *** there is a common mother of all particles
391  (l1[i].McPid()||l1[i].Mct()) && // *** all particles match (FS: PID, Comp:mct)
392  (l2[j].McPid()||l2[j].Mct()) && // *** "
393  2==mclist[m1].NDau() && // *** mother has as many daughters as we combine particles
394  matchPdg == mclist[m1].Pid() ) // *** mother has correct PDG
395  {
396  c.SetId(m1);
397  c.SetMcPid();
398  c.SetMct();
399  c.SetMotherIdx(mclist[m1].MotherIdx());
400  c.SetEvtId(ev1);
401  }
402 
403  out.push_back(c);
404  }
405  }
406  return out.size();
407 }
void SetPdg(int pdg)
Definition: SimpleCand.C:25
void SetP4(TLorentzVector lv)
Definition: SimpleCand.C:20
void SetEvtId(int ev)
Definition: SimpleCand.C:35
Int_t i
Definition: run_full.C:25
void SetMcPid(bool mct=true)
Definition: SimpleCand.C:30
void SetMarker(unsigned int i)
Definition: SimpleCand.C:33
void SetCharge(int ch)
Definition: SimpleCand.C:27
void SetMct(bool mct=true)
Definition: SimpleCand.C:29
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
void SetId(int id)
Definition: SimpleCand.C:26
TFile * out
Definition: reco_muo.C:20
CandList mclist
Definition: toy_core.C:135
void AddDau(SimpleCand *c)
Definition: SimpleCand.C:37
void SetMotherIdx(int idx)
Definition: SimpleCand.C:28
void SetNFS(int n)
Definition: SimpleCand.C:32
int combine ( CandList l1,
CandList l2,
CandList l3,
CandList out,
int  matchPdg = 0 
)

Definition at line 409 of file toy_core.C.

References SimpleCand::AddDau(), c, m2(), mclist, SimpleCand::SetCharge(), SimpleCand::SetEvtId(), SimpleCand::SetId(), SimpleCand::SetMarker(), SimpleCand::SetMcPid(), SimpleCand::SetMct(), SimpleCand::SetMotherIdx(), SimpleCand::SetNFS(), SimpleCand::SetP4(), and SimpleCand::SetPdg().

410 {
411  out.clear();
412 
413  bool same12 = (&l1 == &l2);
414  bool same13 = (&l1 == &l3);
415  bool same23 = (&l2 == &l3);
416 
417  for (unsigned int i1=0;i1<l1.size();++i1)
418  {
419  for (unsigned int i2=0;i2<l2.size();++i2)
420  {
421  if (same12 && i2<i1) continue;
422  if (l1[i1].Marker() & l2[i2].Marker()) continue;
423 
424  for (unsigned int i3=0;i3<l3.size();++i3)
425  {
426  if ((same13 && i3<i1) || (same23 && i3<i2)) continue;
427 
428  if ( l1[i1].Marker() & l3[i3].Marker() ) continue;
429  if ( l2[i2].Marker() & l3[i3].Marker() ) continue;
430 
431  //if (l1[i1].EvtId()!=l2[i2].EvtId() ||
432  // l1[i1].EvtId()!=l3[i3].EvtId() ||
433  // l2[i2].EvtId()!=l3[i3].EvtId() ) continue; // *** tracks from different events
434 
435  SimpleCand c;
436  c.SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4());
437  c.SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() );
438  c.SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS());
439  c.SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() );
440  c.AddDau(&(l1[i1]));c.AddDau(&(l2[i2]));c.AddDau(&(l3[i3]));
441  c.SetPdg(matchPdg);
442 
443  int m1 = l1[i1].MotherIdx();
444  int m2 = l2[i2].MotherIdx();
445  int m3 = l3[i3].MotherIdx();
446 
447  int ev1 = l1[i1].EvtId();
448  int ev2 = l2[i2].EvtId();
449  int ev3 = l3[i3].EvtId();
450 
451  if ( ev1==ev2 && ev2==ev3 && // *** particles are from same event
452  m1>=0 && m1 == m2 && m2 == m3 && // *** there is a common mother of all particles
453  (l1[i1].McPid()||l1[i1].Mct()) && // *** all particles match (FS: PID, Comp:mct)
454  (l2[i2].McPid()||l2[i2].Mct()) && // *** "
455  (l3[i3].McPid()||l3[i3].Mct()) && // *** "
456  3==mclist[m1].NDau() && // *** mother has as many daughters as we combine particles
457  matchPdg == mclist[m1].Pid() ) // *** mother has correct PDG
458  {
459  c.SetId(m1);
460  c.SetMcPid();
461  c.SetMct();
462  c.SetMotherIdx(mclist[m1].MotherIdx());
463  c.SetEvtId(ev1);
464  }
465 
466  out.push_back(c);
467  }
468  }
469  }
470 
471  return out.size();
472 }
void SetPdg(int pdg)
Definition: SimpleCand.C:25
void SetP4(TLorentzVector lv)
Definition: SimpleCand.C:20
void SetEvtId(int ev)
Definition: SimpleCand.C:35
void SetMcPid(bool mct=true)
Definition: SimpleCand.C:30
void SetMarker(unsigned int i)
Definition: SimpleCand.C:33
void SetCharge(int ch)
Definition: SimpleCand.C:27
void SetMct(bool mct=true)
Definition: SimpleCand.C:29
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
void SetId(int id)
Definition: SimpleCand.C:26
TFile * out
Definition: reco_muo.C:20
CandList mclist
Definition: toy_core.C:135
void AddDau(SimpleCand *c)
Definition: SimpleCand.C:37
void SetMotherIdx(int idx)
Definition: SimpleCand.C:28
void SetNFS(int n)
Definition: SimpleCand.C:32
int combine ( CandList l1,
CandList l2,
CandList l3,
CandList l4,
CandList out,
int  matchPdg = 0 
)

Definition at line 474 of file toy_core.C.

References SimpleCand::AddDau(), c, m2(), mclist, SimpleCand::SetCharge(), SimpleCand::SetEvtId(), SimpleCand::SetId(), SimpleCand::SetMarker(), SimpleCand::SetMcPid(), SimpleCand::SetMct(), SimpleCand::SetMotherIdx(), SimpleCand::SetNFS(), SimpleCand::SetP4(), and SimpleCand::SetPdg().

475 {
476  out.clear();
477 
478  bool same12 = (&l1 == &l2);
479  bool same13 = (&l1 == &l3);
480  bool same14 = (&l1 == &l4);
481 
482  bool same23 = (&l2 == &l3);
483  bool same24 = (&l2 == &l4);
484 
485  bool same34 = (&l3 == &l4);
486 
487  for (unsigned int i1=0;i1<l1.size();++i1)
488  {
489  for (unsigned int i2=0;i2<l2.size();++i2)
490  {
491  if (same12 && i2<i1) continue;
492  if (l1[i1].Marker() & l2[i2].Marker()) continue;
493 
494  for (unsigned int i3=0;i3<l3.size();++i3)
495  {
496  if ((same13 && i3<i1) || (same23 && i3<i2)) continue;
497 
498  if ( l1[i1].Marker() & l3[i3].Marker() ) continue;
499  if ( l2[i2].Marker() & l3[i3].Marker() ) continue;
500 
501  for (unsigned int i4=0;i4<l4.size();++i4)
502  {
503  if ((same14 && i4<i1) || (same24 && i4<i2) || (same34 && i4<i3)) continue;
504 
505  if ( l1[i1].Marker() & l4[i4].Marker() ) continue;
506  if ( l2[i2].Marker() & l4[i4].Marker() ) continue;
507  if ( l3[i3].Marker() & l4[i4].Marker() ) continue;
508 
509  //if (l1[i1].EvtId()!=l2[i2].EvtId() ||
510  // l1[i1].EvtId()!=l3[i3].EvtId() ||
511  // l2[i2].EvtId()!=l3[i3].EvtId() ) continue; // *** tracks from different events
512 
513  SimpleCand c;
514  c.SetP4( l1[i1].P4() + l2[i2].P4() + l3[i3].P4() + l4[i4].P4() );
515  c.SetCharge( l1[i1].Charge() + l2[i2].Charge() + l3[i3].Charge() + l4[i4].Charge() );
516  c.SetNFS( l1[i1].NFS() + l2[i2].NFS() + l3[i3].NFS() + l4[i4].NFS() );
517  c.SetMarker( l1[i1].Marker() | l2[i2].Marker() | l3[i3].Marker() | l4[i4].Marker() );
518  c.AddDau(&(l1[i1]));c.AddDau(&(l2[i2]));c.AddDau(&(l3[i3]));c.AddDau(&(l4[i4]));
519  c.SetPdg(matchPdg);
520 
521  int m1 = l1[i1].MotherIdx();
522  int m2 = l2[i2].MotherIdx();
523  int m3 = l3[i3].MotherIdx();
524  int m4 = l4[i4].MotherIdx();
525 
526  int ev1 = l1[i1].EvtId();
527  int ev2 = l2[i2].EvtId();
528  int ev3 = l3[i3].EvtId();
529  int ev4 = l4[i4].EvtId();
530 
531  if ( ev1==ev2 && ev2==ev3 && ev3==ev4 && // *** particles are from same event
532  m1>=0 && m1 == m2 && m2 == m3 && m3 == m4 && // *** there is a common mother of all particles
533  (l1[i1].McPid()||l1[i1].Mct()) && // *** all particles match (FS: PID, Comp:mct)
534  (l2[i2].McPid()||l2[i2].Mct()) && // *** "
535  (l3[i3].McPid()||l3[i3].Mct()) && // *** "
536  (l4[i4].McPid()||l4[i4].Mct()) && // *** "
537  4==mclist[m1].NDau() && // *** mother has as many daughters as we combine particles
538  matchPdg == mclist[m1].Pid() ) // *** mother has correct PDG
539  {
540  c.SetId(m1);
541  c.SetMcPid();
542  c.SetMct();
543  c.SetMotherIdx(mclist[m1].MotherIdx());
544  c.SetEvtId(ev1);
545  }
546 
547  out.push_back(c);
548  }
549  }
550  }
551  }
552 
553  return out.size();
554 }
void SetPdg(int pdg)
Definition: SimpleCand.C:25
void SetP4(TLorentzVector lv)
Definition: SimpleCand.C:20
void SetEvtId(int ev)
Definition: SimpleCand.C:35
void SetMcPid(bool mct=true)
Definition: SimpleCand.C:30
void SetMarker(unsigned int i)
Definition: SimpleCand.C:33
void SetCharge(int ch)
Definition: SimpleCand.C:27
void SetMct(bool mct=true)
Definition: SimpleCand.C:29
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
void SetId(int id)
Definition: SimpleCand.C:26
TFile * out
Definition: reco_muo.C:20
CandList mclist
Definition: toy_core.C:135
void AddDau(SimpleCand *c)
Definition: SimpleCand.C:37
void SetMotherIdx(int idx)
Definition: SimpleCand.C:28
void SetNFS(int n)
Definition: SimpleCand.C:32
void configHisto ( TH1 *  h)

Definition at line 704 of file toy_core.C.

Referenced by toy_core().

705 {
706  h->SetFillStyle(3001);
707  h->SetFillColor(602);
708  h->SetLineStyle(3);
709  h->SetLineColor(602);
710 /* TGaxis *ax = (TGaxis*)h->GetYaxis();
711  ax->SetMaxDigits(2);*/
712 }
double dponline ( TLorentzVector &  v)

Definition at line 189 of file toy_core.C.

References f_res.

Referenced by smearMom().

190 {
191  return f_res->Eval(v.Pt())/100.;
192 }
TF1 * f_res
Definition: toy_core.C:123
__m128 v
Definition: P4_F32vec4.h:4
bool eventAccepted ( CandList l,
double  m = 0,
double  w = 0 
)

Definition at line 320 of file toy_core.C.

References i, and m.

Referenced by toy_core().

321 {
322  bool accepted = false;
323  unsigned int i=0;
324 
325  while (!accepted && i<l.size())
326  //for (unsigned int i=0;i<l.size();++i)
327  {
328  double mass = l[i++].P4().M();
329  if (mass>m-w && mass<m+w) accepted =true;
330  }
331 
332  return accepted;
333 }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
int fillHisto ( CandList l,
TH1 *  hall,
TH1 *  hbg = 0,
double  m = 0,
double  w = 0,
TH1 *  hallsel = 0,
TH1 *  hbgsel = 0,
TH1 *  hsig = 0,
TH1 *  hmm = 0,
TH2 *  hmvsmm = 0 
)

Definition at line 337 of file toy_core.C.

References cnt, fIni, i, and m.

Referenced by toy_core().

338 {
339  int cnt =0;
340  for (unsigned int i=0;i<l.size();++i)
341  {
342  double mass = l[i].P4().M();
343  double miss = (fIni-l[i].P4()).M();
344  hall->Fill(mass);
345 
346  //missing mass
347  if (hmm) hmm->Fill(miss);
348  if (hmvsmm) hmvsmm->Fill(mass, miss);
349 
350  bool mct = l[i].Mct();
351  if (hbg && !mct) hbg->Fill(mass);
352  if (hsig && mct) hsig->Fill(mass);
353  if (mass>m-w && mass<m+w)
354  {
355  cnt++;
356  if (hallsel) hallsel->Fill(mass);
357  if (hbgsel && !mct) hbgsel->Fill(mass);
358  }
359  }
360  return cnt;
361 }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TLorentzVector fIni
Definition: toy_core.C:29
Int_t cnt
Definition: hist-t7.C:106
void init ( double  pideff,
double  misid 
)

Definition at line 235 of file toy_core.C.

References f_res, makePidTable(), mE, mK, mMu, mP, mPi, mPi0, pdg_db, and pdgidx.

Referenced by toy_core().

236 {
237  // *** setting the mapping of PDG code to tab index
238  pdgidx.clear();
239  pdgidx[11]=0;
240  pdgidx[13]=1;
241  pdgidx[211]=2;
242  pdgidx[321]=3;
243  pdgidx[2212]=4;
244 
245  pdg_db=TDatabasePDG::Instance();
246 
247  // *** create pid table
248  makePidTable(pideff, misid);
249 
250  // *** gets particle masses from pdg database and set them globally
251  mE = pdg_db->GetParticle(11)->Mass();
252  mMu = pdg_db->GetParticle(13)->Mass();
253  mPi = pdg_db->GetParticle(211)->Mass();
254  mK = pdg_db->GetParticle(321)->Mass();
255  mP = pdg_db->GetParticle(2212)->Mass();
256 
257  mPi0= pdg_db->GetParticle(111)->Mass();
258 
259  // *** resolution fcn based on Yutie Lang results; see routine dponline above
260  f_res=new TF1("f_res","pol2(0)");
261  f_res->SetParameters(2.367,1.3,0.133);
262  f_res->SetRange(0,10);
263 }
TF1 * f_res
Definition: toy_core.C:123
double mPi0
Definition: toy_core.C:121
std::map< int, int > pdgidx
Definition: toy_core.C:128
TDatabasePDG * pdg_db
Definition: toy_core.C:130
double mE
Definition: toy_core.C:121
double mP
Definition: toy_core.C:121
double mK
Definition: toy_core.C:121
void makePidTable(double pideff, double misid)
Definition: toy_core.C:195
double mMu
Definition: toy_core.C:121
double mPi
Definition: toy_core.C:121
bool isDetected ( double  eff = 0.90)

Definition at line 587 of file toy_core.C.

References fRand.

Referenced by makeRecoCands().

588 {
589  // very simple efficiency cut; might be dependent on candidate itself later
590  if (fRand.Rndm()<eff) return true;
591  return false;
592 }
TRandom3 fRand
Definition: toy_core.C:28
bool isFinalState ( int  n)

Definition at line 180 of file toy_core.C.

Referenced by makeRecoCands(), and toy_core().

181 {
182  n=abs(n);
183  return (n==11 || n==13 || n==211 || n==321 || n==2212 || n==22);
184 }
int n
void makeIni4Vector ( TLorentzVector &  l,
double  s 
)

Definition at line 697 of file toy_core.C.

References mP, p, sqrt(), and X.

Referenced by toy_core().

698 {
699  double X = (s*s-2*mP*mP)/(2*mP);
700  double p = sqrt(X*X - mP*mP);
701  l.SetXYZM(0,0,p,s);
702 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
TLorentzVector s
Definition: Pnd2DStar.C:50
Double_t p
Definition: anasim.C:58
double mP
Definition: toy_core.C:121
double X
Definition: anaLmdDigi.C:68
void makePidSelection ( CandList l)

Definition at line 676 of file toy_core.C.

References eminus, eplus, gam, kminus, kplus, mE, mK, mMu, mP, mPi, muminus, muplus, piminus, piplus, pminus, pplus, and select().

Referenced by toy_core().

677 {
678  // *** prepare globally defined PID lists
679  select(l, eplus, 1, -11, mE);
680  select(l, eminus, -1, 11, mE);
681 
682  select(l, muplus, 1, -13, mMu);
683  select(l, muminus, -1, 13, mMu);
684 
685  select(l, piplus, 1, 211, mPi);
686  select(l, piminus, -1, -211, mPi);
687 
688  select(l, kplus, 1, 321, mK);
689  select(l, kminus, -1, -321, mK);
690 
691  select(l, pplus, 1, 2212, mP);
692  select(l, pminus, -1, -2212, mP);
693 
694  select(l, gam, 0, 22, 0);
695 }
CandList gam
Definition: toy_core.C:138
CandList pplus
Definition: toy_core.C:138
CandList muplus
Definition: toy_core.C:138
double mE
Definition: toy_core.C:121
CandList kminus
Definition: toy_core.C:138
CandList piplus
Definition: toy_core.C:138
double mP
Definition: toy_core.C:121
CandList eplus
Definition: toy_core.C:138
CandList pminus
Definition: toy_core.C:138
CandList eminus
Definition: toy_core.C:138
double mK
Definition: toy_core.C:121
CandList kplus
Definition: toy_core.C:138
double mMu
Definition: toy_core.C:121
void select(CandList &in, CandList &out, int chrg=0, int pdg=0, double mass=0.139)
Definition: toy_core.C:638
CandList muminus
Definition: toy_core.C:138
CandList piminus
Definition: toy_core.C:138
double mPi
Definition: toy_core.C:121
void makePidTable ( double  pideff,
double  misid 
)

Definition at line 195 of file toy_core.C.

References i, pidtab, and printf().

Referenced by init().

196 {
197  cout<< "Using PID table:"<<endl;
198 
199  if (pideff<0 && misid<0)
200  {
201  for (int i=0;i<5;++i)
202  {
203  for (int j=0;j<5;++j)
204  {
205  //pidtab[j+5*i] = pidreal[j+5*i];
206  printf("%4.0f",pidtab[j+5*i]);
207  //cout << pidtab[i+5*j]<<" ";
208  }
209  cout<< endl;
210  }
211  return;
212  }
213 
214  if (pideff<0) pideff=0;
215  if (pideff>100) pideff=100;
216  if (misid>100) misid=100;
217 
218  // *** neff is the efficiency for particles of wrong type
219  //double neff = pideff*(100-pidpur)/(4*pidpur);
220  //if (neff>100) neff=100;
221 
222  for (int i=0;i<5;++i)
223  {
224  for (int j=0;j<5;++j)
225  {
226  if (i==j) pidtab[i+5*j] = pideff;
227  else pidtab[i+5*j] = misid;
228  cout << pidtab[i+5*j]<<" ";
229  }
230  cout<< endl;
231  }
232 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double pidtab[25]
Definition: toy_core.C:107
Int_t i
Definition: run_full.C:25
void makeRecoCands ( CandList mc,
CandList reco,
double  eff = 0.90,
double  dp = 0.05,
double  dtht = 0.001,
double  dphi = 0.001 
)

Definition at line 594 of file toy_core.C.

References c, SimpleCand::Charge(), fdE, fNdphi, fNdtht, fNeutEff, i, isDetected(), isFinalState(), pid(), SimpleCand::Pid(), SimpleCand::SetMarker(), SimpleCand::SetMass(), SimpleCand::SetPdg(), and smearMom().

Referenced by toy_core().

595 {
596  reco.clear();
597 
598  unsigned int marker = 1;
599 
600  for (unsigned int i=0;i<mc.size();i++)
601  {
602  SimpleCand c=mc[i];
603  int pid = abs(c.Pid());
604  if (!isFinalState(pid)) continue;
605 
606  if (pid!=22 && isDetected(eff)) // *** charged track
607  {
608  smearMom(c,dp,dtht,dphi);
609  // set pion mass as default
610  c.SetMass(0.13957);
611  c.SetMarker(marker);
612  c.SetPdg(211*c.Charge());
613  marker *=2;
614  reco.push_back(c);
615  }
616  else if (pid==22 && isDetected(fNeutEff)) // *** neutral
617  {
618  smearMom(c,fdE, fNdtht, fNdphi);
619  c.SetMarker(marker);
620  c.SetPdg(22);
621  marker *=2;
622  reco.push_back(c);
623  }
624  }
625 }
void SetPdg(int pdg)
Definition: SimpleCand.C:25
void smearMom(SimpleCand &c, double dpr=0.05, double dtht=0.000, double dphi=0.000)
Definition: toy_core.C:557
Int_t i
Definition: run_full.C:25
int pid()
const double fdE
Definition: toy_core.C:39
int Pid() const
Definition: SimpleCand.C:40
void SetMarker(unsigned int i)
Definition: SimpleCand.C:33
void SetMass(double mass)
Definition: SimpleCand.C:22
const double fNdtht
Definition: toy_core.C:40
int reco()
const double fNdphi
Definition: toy_core.C:41
bool isDetected(double eff=0.90)
Definition: toy_core.C:587
bool isFinalState(int n)
Definition: toy_core.C:180
const double fNeutEff
Definition: toy_core.C:38
int Charge() const
Definition: SimpleCand.C:44
int massCrit ( CandList l,
double  m,
double  w 
)

Definition at line 307 of file toy_core.C.

References cnt, and i.

308 {
309  int cnt = 0;
310  for (unsigned int i=0;i<l.size();++i)
311  {
312  double mass=l[i].P4().M();
313  if (mass>m-w && mass<m+w) cnt++;
314  }
315 
316  return cnt;
317 }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
Int_t cnt
Definition: hist-t7.C:106
void printAllLists ( )

Definition at line 283 of file toy_core.C.

References eminus, eplus, gam, kminus, kplus, mclist, muminus, muplus, piminus, piplus, pminus, pplus, printList(), and recolist.

284 {
285  printList(mclist, "MC List");
286  printList(recolist, "Reco List");
287 
288  printList(eplus, "e+ List");
289  printList(eminus, "e- List");
290 
291  printList(muplus, "mu+ List");
292  printList(muminus, "mu- List");
293 
294  printList(piplus, "pi+ List");
295  printList(piminus, "pi- List");
296 
297  printList(kplus, "k+ List");
298  printList(kminus, "k- List");
299 
300  printList(pplus, "p+ List");
301  printList(pminus, "p- List");
302 
303  printList(gam, "gamma List");
304 }
CandList recolist
Definition: toy_core.C:135
CandList gam
Definition: toy_core.C:138
CandList pplus
Definition: toy_core.C:138
CandList muplus
Definition: toy_core.C:138
CandList kminus
Definition: toy_core.C:138
CandList piplus
Definition: toy_core.C:138
CandList eplus
Definition: toy_core.C:138
CandList pminus
Definition: toy_core.C:138
CandList eminus
Definition: toy_core.C:138
void printList(CandList &l, TString tit="")
Definition: toy_core.C:275
CandList mclist
Definition: toy_core.C:135
CandList kplus
Definition: toy_core.C:138
CandList muminus
Definition: toy_core.C:138
CandList piminus
Definition: toy_core.C:138
void printCand ( SimpleCand  c)

Definition at line 266 of file toy_core.C.

References SimpleCand::Charge(), SimpleCand::Id(), SimpleCand::McPid(), SimpleCand::Mct(), SimpleCand::MotherIdx(), SimpleCand::NFS(), SimpleCand::NSiblings(), SimpleCand::P4(), and SimpleCand::Pid().

Referenced by printList().

267 {
268  cout <<c.Id()<<" pid:"<<c.Pid()<<" ("<<c.P4().X()<<","<<c.P4().Y()<<","<<c.P4().Z()<<";"<<c.P4().T()<<") ";
269  cout <<c.Charge()<<" "<<c.P4().M();
270  cout <<" moth:"<<c.MotherIdx()<<" nsib:"<<c.NSiblings()<<" nfs:"<<c.NFS();
271  cout <<" mcpid:"<<c.McPid()<<" mct:"<<c.Mct()<<endl;
272 }
int NFS() const
Definition: SimpleCand.C:47
bool Mct() const
Definition: SimpleCand.C:48
int Pid() const
Definition: SimpleCand.C:40
int NSiblings() const
Definition: SimpleCand.C:46
int Id() const
Definition: SimpleCand.C:42
TLorentzVector P4() const
Definition: SimpleCand.C:39
int MotherIdx() const
Definition: SimpleCand.C:45
int Charge() const
Definition: SimpleCand.C:44
bool McPid() const
Definition: SimpleCand.C:49
void printList ( CandList l,
TString  tit = "" 
)

Definition at line 275 of file toy_core.C.

References printCand().

Referenced by printAllLists().

276 {
277  if (tit!="") cout << tit<<endl;
278  for (unsigned int j=0;j<l.size();++j) printCand(l[j]);
279  cout <<endl;
280 }
void printCand(SimpleCand c)
Definition: toy_core.C:266
void qaCand ( TString  pre,
SimpleCand c,
SimpleNtp n 
)

Definition at line 714 of file toy_core.C.

References SimpleCand::Charge(), SimpleNtp::Column(), fIni, SimpleCand::McPid(), SimpleCand::Mct(), SimpleCand::P4(), SimpleCand::Pdg(), and SimpleCand::Pid().

Referenced by writeTuple().

715 {
716  TLorentzVector l = c.P4();
717  TVector3 boost = fIni.BoostVector();
718  TLorentzVector lb = l;
719  lb.Boost(-boost);
720 
721  n->Column(pre+"px", l.Px());
722  n->Column(pre+"py", l.Py());
723  n->Column(pre+"pz", l.Pz());
724  n->Column(pre+"p", l.P());
725  n->Column(pre+"e", l.E());
726  n->Column(pre+"m", l.M());
727  n->Column(pre+"pdg", c.Pdg());
728  n->Column(pre+"tpdg", c.Pid());
729  n->Column(pre+"ch", c.Charge());
730 
731  n->Column(pre+"pt", l.Pt());
732  n->Column(pre+"tht", l.Theta());
733  n->Column(pre+"phi", l.Phi());
734  n->Column(pre+"pcm", lb.P());
735 
736  n->Column(pre+"mct", c.Mct()||c.McPid() );
737 }
int Pdg() const
Definition: SimpleCand.C:41
bool Mct() const
Definition: SimpleCand.C:48
int Pid() const
Definition: SimpleCand.C:40
TLorentzVector fIni
Definition: toy_core.C:29
TLorentzVector P4() const
Definition: SimpleCand.C:39
void Column(TString name, Float_t value)
Definition: SimpleNtp.C:33
int Charge() const
Definition: SimpleCand.C:44
bool McPid() const
Definition: SimpleCand.C:49
void select ( CandList in,
CandList out,
int  chrg = 0,
int  pdg = 0,
double  mass = 0.139 
)

Definition at line 638 of file toy_core.C.

References c, SimpleCand::Charge(), fRand, i, pdg_db, pdgidx, SimpleCand::Pid(), pidtab, SimpleCand::SetMass(), SimpleCand::SetMcPid(), and SimpleCand::SetPdg().

Referenced by makePidSelection().

639 {
640  out.clear();
641 
642  TParticlePDG *part = pdg_db->GetParticle(pdg);
643 
644  //pdg *= pdg<20 ? -chrg : chrg;
645 
646  if (part) mass = part->Mass();
647  if (mass<0) mass = 0.139;
648 
649  for (unsigned int i=0;i<in.size();++i)
650  {
651  SimpleCand c=in[i];
652 
653  // select a specific charge in any case
654  if (c.Charge()==chrg)
655  {
656  c.SetMass(mass);
657  if (c.Pid()==pdg) c.SetMcPid();
658  c.SetPdg(pdg);
659  if (pdg==0 || pdg==22) out.push_back(c); // do we want select a pdg code? 0=only charge
660  else
661  {
662  // invalid pdg code?
663  if (pdgidx.find(abs(pdg))==pdgidx.end()) continue;
664 
665  int selidx = pdgidx[abs(pdg)];
666  int partidx = pdgidx[abs(c.Pid())];
667  double prob = pidtab[5*selidx + partidx]/100.;
668  //cout <<pdg <<" "<<c.Pid()<<" : "<<selidx<<" "<<partidx<<" P:"<<prob<<endl;
669 
670  if (fRand.Rndm()<prob) out.push_back(c);
671  }
672  }
673  }
674 }
void SetPdg(int pdg)
Definition: SimpleCand.C:25
double pidtab[25]
Definition: toy_core.C:107
Int_t i
Definition: run_full.C:25
std::map< int, int > pdgidx
Definition: toy_core.C:128
TDatabasePDG * pdg_db
Definition: toy_core.C:130
TRandom3 fRand
Definition: toy_core.C:28
void SetMcPid(bool mct=true)
Definition: SimpleCand.C:30
int Pid() const
Definition: SimpleCand.C:40
void SetMass(double mass)
Definition: SimpleCand.C:22
TFile * out
Definition: reco_muo.C:20
int Charge() const
Definition: SimpleCand.C:44
void selectMass ( CandList in,
CandList out,
double  mmean = 0,
double  mw = 0 
)

Definition at line 628 of file toy_core.C.

References fabs(), and i.

Referenced by toy_core().

629 {
630  out.clear();
631 
632  for (unsigned int i=0;i<in.size();++i)
633  if (fabs(in[i].P4().M()-mmean)<mw) out.push_back(in[i]);
634 
635 }
Int_t i
Definition: run_full.C:25
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TFile * out
Definition: reco_muo.C:20
void setStyle ( )

Definition at line 141 of file toy_core.C.

Referenced by toy_core().

142 {
143  gStyle->SetPadTopMargin(0.13);
144  gStyle->SetPadBottomMargin(0.18);
145  gStyle->SetPadLeftMargin(0.2);
146  gStyle->SetPadRightMargin(0.015);
147 
148  gStyle->SetLabelSize(0.075,"X");
149  gStyle->SetLabelSize(0.07,"Y");
150 
151  gStyle->SetStatY(0.87);
152  gStyle->SetStatX(0.985);
153  gStyle->SetStatW(0.4);
154  gStyle->SetStatH(0.12);
155  gStyle->SetOptStat("e"); // only entries
156 
157  gStyle->SetTitleH(0.1);
158  gStyle->SetTitleX(0.08);
159  gStyle->SetTitleOffset(1.1,"x");
160  gStyle->SetTitleXSize(0.075);
161 }
void smearMom ( SimpleCand c,
double  dpr = 0.05,
double  dtht = 0.000,
double  dphi = 0.000 
)

Definition at line 557 of file toy_core.C.

References dponline(), fRand, m, p, SimpleCand::P4(), and SimpleCand::SetP4().

Referenced by makeRecoCands().

558 {
559  TLorentzVector p4=c.P4();
560 
561  // *** use resolution function
562  if (dpr<0) dpr = dponline(p4);
563 
564  double p = p4.P();
565  double m = p4.M();
566 
567  double dp = p*dpr;
568  double newp = -1;
569 
570  if (dp==0) newp=p;
571  while (newp<0) newp = p4.P() + fRand.Gaus(0.0,dp);
572 
573  p4.SetVectM( p4.Vect().Unit()*newp, m );
574 
575  double newtht = p4.Theta();
576  if (dtht!=0) newtht += fRand.Gaus(0.,dtht);
577  p4.SetTheta(newtht);
578 
579  double newphi = p4.Phi();
580  if (dphi!=0) newphi += fRand.Gaus(0.,dphi);
581  p4.SetPhi(newphi);
582 
583  c.SetP4(p4);
584 
585 }
void SetP4(TLorentzVector lv)
Definition: SimpleCand.C:20
__m128 m
Definition: P4_F32vec4.h:28
TRandom3 fRand
Definition: toy_core.C:28
Double_t p
Definition: anasim.C:58
TLorentzVector P4() const
Definition: SimpleCand.C:39
double dponline(TLorentzVector &v)
Definition: toy_core.C:189
int toy_core ( TString  fsig,
int  nev = 2,
double  sqrts = 3.77,
bool  simcut = true,
bool  evcut = false,
double  dp = 0.05,
double  trkeff = 95.,
double  pideff = 95.,
double  misid = 5.,
double  P_mix = 0.00,
bool  writentp = false,
int  mode = 9999 
)

Definition at line 841 of file toy_core.C.

References boostList(), c, c1, c2, EventShape::ChrgPSumCms(), EventShape::ChrgPtSumLab(), combine(), configHisto(), Double_t, eminus, eplus, eventAccepted(), evtno, f, fD0Mass, fD0Pdg, fD0sig, fD0win, fDMass, fDPdg, fDsig, fDsMass, fDsPdg, fDssig, fDswin, fDwin, feesigconst, feesigslope, feewin, fEtacMass, fEtacPdg, fEtacsig, fEtacwin, filename, fillHisto(), fIni, fJMass, fJpsiPdg, fJsig, fJwin, fKsMass, fKsPdg, fKssig, fKswin, fLamcMass, fLamcPdg, fLamcsig, fLamcwin, fLamMass, fLamPdg, fLamsig, fLamwin, fMAX, EventShape::FoxWolfMomR(), fPhiMass, fPhiPdg, fPhisig, fPhiwin, fPi0Mass, fPi0Pdg, fPi0sig, fPi0win, fRand, gam, globmode, high, i, init(), isFinalState(), kminus, kplus, m, makeIni4Vector(), makePidSelection(), makeRecoCands(), max(), mcFSlist, mclist, min(), mode, EventShape::MultPminCms(), muminus, muplus, nbins, EventShape::NCharged(), ne, EventShape::NeutESumCms(), nk, nlep, nmu, EventShape::NNeutral(), EventShape::NParticles(), npi, npr, nsig, nsigpiks, offset(), p, pdg_db, piminus, piplus, plotname, EventShape::PmaxCms(), EventShape::PmaxLab(), EventShape::PminCms(), pminus, pos, pplus, pt(), EventShape::Ptmax(), EventShape::PtSumLab(), pz, recocmslist, recolist, selectMass(), SimpleCand::SetDau(), SimpleCand::SetEvtId(), SimpleCand::SetMotherIdx(), SimpleCand::SetNSiblings(), setStyle(), EventShape::SumChrgPminCms(), t, TString, and writeTuple().

843 {
844  setStyle();
845 
846  globmode= mode;
847 
848  fRand.SetSeed(314);
849 
850  init(pideff, misid);
851 
852  int i,j,k;
853 
854  makeIni4Vector(fIni, sqrts);
855 
856  fIni.Print();
857 
860 
861  fPhiwin = nsig*fPhisig;
862  fDwin = nsig*fDsig;
863  fD0win = nsig*fD0sig;
864  fDswin = nsig*fDssig;
865  fJwin = nsig*fJsig;
867  feewin = nsig*(feesigconst+sqrts*feesigslope);
869  fLamwin = nsig*fLamsig;
870 
871  //gStyle->SetOptStat(1111);
872 
873  // *** open file and get tree
874  TFile *f=new TFile(fsig,"READ");
875  if (f->IsZombie())
876  {
877  cout <<"File not found:"<<fsig<<endl;
878  return;
879  }
880 
881  bool dpm=fsig.Contains("DPM"); // *** DPM events
882  TString treename = dpm ? "data" : "ntp"; // *** set treename
883  TTree *t=(TTree*)f->Get(treename);
884 
885  if (t==0)
886  {
887  cout <<"Tree '"<<treename<<"' not found in '"<<fsig<<"'."<<endl;
888  return;
889  }
890 
891  // *** how many events ?
892  int Nevt = t->GetEntriesFast();
893  if (nev==0) nev = Nevt;
894 
895  double mmean=0, mwsig=0, mwoff=0;
896  int matchPDG=0;
897 
898  // *** choose histogram scale according to resonance
899  high = mmean+2;
900 
901  TCanvas *c1=new TCanvas("c1","c1",10,10,600,300);
902  c1->Divide(2,1);
903  TCanvas *c2=new TCanvas("c2","c2",20,20,1800,800);
904  c2->Divide(5,2,0.005,0.01);
905 
906 /* TCanvas *c3=new TCanvas("c3","c3",1010,10,600,600);
907  c3->Divide(2,2);*/
908 
909 // TCanvas *c4=new TCanvas("c4","c4",1220,20,500,500);
910 
911  double min=0, max=6.0, min2=0.5;
912 
913  // *** create some histograms
914  TH1F *h_mom= new TH1F("h_mom","Momenta",200,0,5);
915  TH1F *h_momc= new TH1F("h_momc","Momenta charged",200,0,5);
916  TH1F *h_momn= new TH1F("h_momn","Momenta neutral",200,0,5);
917  TH1F *h_mult= new TH1F("h_mult","Multiplicity",50,-0.5,49.5);
918  TH1F *h_multrec= new TH1F("h_multrec","Multiplicity reco",50,-0.5,49.5);
919  TH1F *h_multc= new TH1F("h_multc","Multiplicity charged",30,-0.5,29.5);
920  TH1F *h_multn= new TH1F("h_multn","Multiplicity neutral",50,-0.5,49.5);
921  TH1F *h_fw1= new TH1F("h_fw1","Fox Wolfram R1",300,-1.1,1.1);
922  TH1F *h_pmax= new TH1F("h_pmax","pmax cms",300,0,5);
923 
924  TH1F *h_mult_k = new TH1F("h_mult_k","Multiplicity Kaons",10,-0.5,9.5);
925  TH1F *h_mult_lep = new TH1F("h_mult_lep","Multiplicity Leptons",10,-0.5,9.5);
926  TH1F *h_sum_klep = new TH1F("h_sum_lep","Sum Kaons + Leptons",15,-0.5,14.5);
927  TH2F *h_mult_klep=new TH2F("h_mult_klep","#Kaons vs. #Leptons",10,-0.5,9.5, 10, -0.5, 9.5);
928  h_mult_klep->SetYTitle("#Leptons");
929  h_mult_klep->SetXTitle("#Kaons");
930 
931  // ****** pi0
932  TH1F *h_pi0=new TH1F("h_pi0","#pi^{0} #rightarrow #gamma#gamma",200,min,0.4);
933  TH1F *h_pi0sel=new TH1F("h_pi0sel","Pi0",200,min,0.4);
934  TH1F *h_pi0sig=new TH1F("h_pi0sig","Pi0",200,min,0.4);
935  h_pi0sig->SetLineColor(2);
936  configHisto(h_pi0sel);
937 
938  // ****** Ks
939  TH1F *h_ks=new TH1F("h_ks","K_{S}^{0} #rightarrow #pi^{+}#pi^{-}",200,0.2,0.8);
940  TH1F *h_kssel=new TH1F("h_kssel","Pi0",200,0.2,0.8);
941  TH1F *h_kssig=new TH1F("h_kssig","Pi0",200,0.2,0.8);
942  h_kssig->SetLineColor(2);
943  configHisto(h_kssel);
944 
945  // ****** Jpsi -> ee
946  TH1F *h_jpsi=new TH1F("h_jpsi","J/#psi #rightarrow e^{+}e^{-}",nbins,min,max);
947  TH1F *h_jpsisel=new TH1F("h_jpsisel","J/psi",nbins,min,max);
948  TH1F *h_jpsisig=new TH1F("h_jpsisig","J/psi",nbins,min,max);
949  h_jpsisig->SetLineColor(2);
950  configHisto(h_jpsisel);
951 
952  // ****** Jpsi -> mu mu
953  TH1F *h_jpsi2=new TH1F("h_jpsi2","J/#psi #rightarrow #mu^{+}#mu^{-}",nbins,min,max);
954  TH1F *h_jpsi2sel=new TH1F("h_jpsi2sel","J/psi",nbins,min,max);
955  TH1F *h_jpsi2sig=new TH1F("h_jpsi2sig","J/psi",nbins,min,max);
956  h_jpsi2sig->SetLineColor(2);
957  configHisto(h_jpsi2sel);
958 
959  // ****** eta_c -> Ks K pi
960  TH1F *h_etac=new TH1F("h_etac","#eta_{c} #rightarrow K_{S} K^{+} #pi^{-}",nbins,min,max);
961  TH1F *h_etacsel=new TH1F("h_etacsel","etac",nbins,min,max);
962  TH1F *h_etacsig=new TH1F("h_etacsig","etac",nbins,min,max);
963  h_etacsig->SetLineColor(2);
964  configHisto(h_etacsel);
965 
966  // ****** D0 -> K- pi+
967  TH1F *h_d0=new TH1F("h_d0","D^{0} #rightarrow K^{-}#pi^{+}",nbins,min,max);
968  TH1F *h_d0sel=new TH1F("h_d0sel","D0",nbins,min,max);
969  TH1F *h_d0sig=new TH1F("h_d0sig","D0",nbins,min,max);
970  h_d0sig->SetLineColor(2);
971  configHisto(h_d0sel);
972 
973  // ****** D+ -> K- pi+ pi+
974  TH1F *h_dpm=new TH1F("h_dpm","D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}",nbins,min,max);
975  TH1F *h_dpmsel=new TH1F("h_dpmsel","D#pm",nbins,min,max);
976  TH1F *h_dpmsig=new TH1F("h_dpmsig","D#pm",nbins,min,max);
977  h_dpmsig->SetLineColor(2);
978  configHisto(h_dpmsel);
979 
980  // ****** Ds+ -> K+ K- pi+
981  TH1F *h_ds=new TH1F("h_ds","D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}",nbins,min,max);
982  TH1F *h_dssel=new TH1F("h_dssel","Ds",nbins,min,max);
983  TH1F *h_dssig=new TH1F("h_dssig","Ds",nbins,min,max);
984  h_dssig->SetLineColor(2);
985  configHisto(h_dssel);
986 
987  // ****** phi -> K+ K-
988  TH1F *h_phi=new TH1F("h_phi","#phi #rightarrow K^{+}K^{-}",nbins,min2,max/2);
989  TH1F *h_phisel=new TH1F("h_phisel","Phi",nbins,min2,max/2);
990  TH1F *h_phisig=new TH1F("h_phisig","Phi",nbins,min2,max/2);
991  h_phisig->SetLineColor(2);
992  configHisto(h_phisel);
993 
994  // ****** Lambda_c -> p K- pi+
995  TH1F *h_lamc=new TH1F("h_lamc","#Lambda_{c} #rightarrow pK^{-}#pi^{+}",nbins,min,max);
996  TH1F *h_lamcsel=new TH1F("h_lamcsel","Lam_c",nbins,min,max);
997  TH1F *h_lamcsig=new TH1F("h_lamcsig","Lam_c",nbins,min,max);
998  h_lamcsig->SetLineColor(2);
999  configHisto(h_lamcsel);
1000 
1001  // ****** Lambda -> p pi-
1002  TH1F *h_lam=new TH1F("h_lam","#Lambda #rightarrow p#pi^{-}",nbins,min2,max/2);
1003  TH1F *h_lamsel=new TH1F("h_lamsel","Lam",nbins,min2,max/2);
1004  TH1F *h_lamsig=new TH1F("h_lamsig","Lam",nbins,min2,max/2);
1005  h_lamsig->SetLineColor(2);
1006  configHisto(h_lamsel);
1007 
1008  // ****** pp -> e+ e-
1009  TH1F *h_ee=new TH1F("h_ee","p#bar{p} #rightarrow e^{+}e^{-}",nbins,min,max*1.2);
1010  TH1F *h_eesel=new TH1F("h_eesel","ee",nbins,min,max*1.2);
1011  TH1F *h_eesig=new TH1F("h_eesig","ee",nbins,min,max*1.2);
1012  h_eesig->SetLineColor(2);
1013  configHisto(h_eesel);
1014 
1015 
1016  h_jpsi->SetXTitle("m(e^{+}e^{-}) [GeV/c^{2}]");
1017  h_jpsi2->SetXTitle("m(#mu^{+}#mu^{-}) [GeV/c^{2}]");
1018  h_etac->SetXTitle("m(K_{S} K^{+}#pi^{-}) [GeV/c^{2}]");
1019 
1020  h_d0->SetXTitle("m(K^{-}#pi^{+}) [GeV/c^{2}]");
1021 
1022  h_dpm->SetXTitle("m(K^{-}#pi^{+}#pi^{+}) [GeV/c^{2}]");
1023 
1024  h_ds->SetXTitle("m(K^{+}K^{-}#pi^{+}) [GeV/c^{2}]");
1025 
1026  h_phi->SetXTitle("m(K^{+}K^{-}) [GeV/c^{2}]");
1027  h_lamc->SetXTitle("m(pK^{-}#pi^{+}) [GeV/c^{2}]");
1028  h_lam->SetXTitle("m(p#pi^{-}) [GeV/c^{2}]");
1029  h_ee->SetXTitle("m(e^{+}e^{-}) [GeV/c^{2}]");
1030 
1031  // *** prepare the tree to loop through
1032 
1033  Int_t nTrk,Id[fMAX],DF[fMAX],DL[fMAX];
1034  Double_t px[fMAX],py[fMAX],pz[fMAX],E[fMAX],m[fMAX];
1035  TClonesArray* DpmPart=0;
1036 
1037  if (dpm)
1038  {
1039  DpmPart=new TClonesArray("TParticle",100);
1040  t->SetBranchAddress("Npart",&nTrk);
1041  t->SetBranchAddress("Particles", &DpmPart);
1042  }
1043  else
1044  {
1045  t->SetBranchAddress("nTrk",&nTrk);
1046  t->SetBranchAddress("Id",Id);
1047  t->SetBranchAddress("DF",DF);
1048  t->SetBranchAddress("DL",DL);
1049  t->SetBranchAddress("px",px);
1050  t->SetBranchAddress("py",py);
1051  t->SetBranchAddress("pz",pz);
1052  t->SetBranchAddress("E",E);
1053  t->SetBranchAddress("m",m);
1054  }
1055 
1056  TFile *fn=0;
1057 
1058  TString filename(fsig(fsig.Index("/")+1,fsig.Length())+"_ntp.root");
1059 
1060  if (writentp) fn=new TFile(filename, "RECREATE");
1061 
1062  SimpleNtp *nphi = new SimpleNtp("nphi","phi -> K+K-");
1063  SimpleNtp *nd0 = new SimpleNtp("nd0","D0 -> K+ pi+");
1064  SimpleNtp *ndpm = new SimpleNtp("ndpm","D+ -> K- pi+ pi+");
1065  SimpleNtp *nds = new SimpleNtp("nds","Ds -> K+ K- pi+");
1066  SimpleNtp *njpsi1 = new SimpleNtp("njpsi1","J/psi -> e+ e-");
1067  SimpleNtp *njpsi2 = new SimpleNtp("njpsi2","J/psi -> mu+ mu-");
1068  SimpleNtp *netac = new SimpleNtp("netac","eta_c -> KS (pi+pi-) K- pi+");
1069  SimpleNtp *nee = new SimpleNtp("nee","ppbar -> e+ e-");
1070  SimpleNtp *nlam = new SimpleNtp("nlam","Lambda -> p pi-");
1071  SimpleNtp *nlamc = new SimpleNtp("nlamc","Lambda_c -> p K- pi+");
1072 
1073  int combCnt=0; // how many combinatione are within our mass criterion
1074  int evCnt=0; // how many _events_ (not combinations!) are within our mass criterion
1075  int evMultCut=0;
1076 
1077  // *** the event loop
1078 
1079  int mixevts=1;
1080  int currmix=0;
1081 
1082  int cntInLam=0;
1083 
1084  // how many events are tagged by individual algo?
1085  bool channelselect[10];
1086  double channelcount[10];
1087  TString channelname[10]={"Phi(KK)","pp->ee" ,"Lam(ppi)","etac(KS K pi)","J/psi(ee)","J/psi(mumu)","D+-(K2pi)","D0(Kpi)","Ds(KKpi)","Lamc(pKpi)"};
1088 
1089  for (i=0;i<10;++i) channelcount[i]=0.;
1090 
1091  if (fRand.Rndm()<P_mix) mixevts=2;
1092 
1093  for (i=0;i<nev;++i)
1094  {
1095  evtno = i;
1096  t->GetEntry(i);
1097 
1098  if (i%5000==0) cout <<"ev "<<i<<endl;
1099 
1100  // *** read in from file the mc candidate
1101  if (0==currmix)
1102  {
1103  mclist.clear(); // *** contains all MC cands (also non-final-states)
1104  mcFSlist.clear(); // *** contains only final state MC cands
1105  }
1106 
1107  bool good = true;
1108 
1109  if (dpm)
1110  {
1111  int npi = 0;
1112  int nstab = 0;
1113 
1114  for (j=0;j<nTrk;++j)
1115  {
1116  TParticle *pt=(TParticle*)DpmPart->At(j);
1117  Id[j] = pt->GetPdgCode();
1118  int pdg = abs(Id[j]);
1119  px[j] = pt->Px();
1120  py[j] = pt->Py();
1121  pz[j] = pt->Pz();
1122  E[j] = pt->Energy();
1123  m[j] = pt->GetMass();
1124  DF[j] = 0;
1125  DL[j] = -1;
1126  if (pdg==211) npi++;
1127  if (isFinalState(pdg)) nstab++;
1128  }
1129  //if (npi!=4 || nstab!=npi ) good = false;
1130  }
1131 
1132  if (!good) continue;
1133 
1134  for (j=0;j<nTrk;++j)
1135  {
1136  int chrg = 0;
1137  int pdg = abs(Id[j]);
1138  TParticlePDG *p=pdg_db->GetParticle(Id[j]);
1139  if (p) chrg = p->Charge();
1140  if (abs(chrg)>1) chrg/=3;
1141 
1142  SimpleCand c(px[j], py[j], pz[j], E[j], Id[j], j, chrg);
1143  c.SetDau(DF[j], DL[j]);
1144 
1145  for (k=0;k<j;++k) if (j>=DF[k] && j<=DL[k])
1146  {
1147  c.SetMotherIdx(k);
1148  c.SetNSiblings(DL[k]-DF[k]+1);
1149  }
1150 
1151  c.SetEvtId(i);
1152 
1153  mclist.push_back(c);
1154 
1155  // final state particle?
1156  if (isFinalState(pdg)) mcFSlist.push_back(c);
1157  }
1158 
1159  if (++currmix<mixevts) continue;
1160 
1161  currmix=0;
1162 
1163  h_mult->Fill(mcFSlist.size());
1164 
1165  // *** if mass cut is negative (= number of sigmas), compute absolute window size
1166  //if (mwin<0) mwidth=-mwin*(dp*mwsig+mwoff);
1167 
1168  // *** prepare the toy reco: smear momentum and apply track efficiency (both flat at the moment)
1169  makeRecoCands(mcFSlist, recolist, trkeff/100., dp );
1170 
1171  // *** the boost of the system
1172  TVector3 boost = fIni.BoostVector();
1173  boostList(recolist, recocmslist, boost);
1174 
1175  // *** Make Event Selection
1176  EventShape evsh(recolist, fIni);
1177 /* if (evcut)
1178  {
1179  if (evshape.ChrgPtSumLab()<1.5) continue;
1180  }*/
1181 
1182  h_multrec->Fill(recolist.size());
1183  //cout <<mcFSlist.size()<<" "<<recolist.size()<<endl;
1184 
1185  // *** prepare all pid list according to the pidtable probabilities
1187 
1188  npi = piplus.size()+piminus.size();
1189  nk = kplus.size()+kminus.size();
1190  npr = pplus.size()+pminus.size();
1191  ne = eplus.size()+eminus.size();
1192  nmu = muplus.size()+muminus.size();
1193  nlep = ne+nmu;
1194 
1195 /* int nk10 = 0; // # kaons with p>1.0
1196  for (j=0;j<kplus.size();++j) if (kplus[j].P4().P()>1.0) nk10++;
1197  for (j=0;j<kminus.size();++j) if (kminus[j].P4().P()>1.0) nk10++;
1198 
1199  int npr10 = 0; // # protons with p>1.0
1200  for (j=0;j<pplus.size();++j) if (pplus[j].P4().P()>1.0) npr10++;
1201  for (j=0;j<pminus.size();++j) if (pminus[j].P4().P()>1.0) npr10++;*/
1202 
1203  h_mult_k->Fill(nk);
1204  h_mult_lep->Fill(nlep);
1205  h_mult_klep->Fill(nk, nlep);
1206  h_sum_klep->Fill(nk + nlep);
1207 
1208 
1209  // *** the lists we need for combinatorics
1210  CandList comb1, comb2, comb3;
1211 
1212  CandList LPhi, LPi0, LKs; // phi -> KK , pi0 -> gg (mass cut), KS -> pi+ pi- (mass cut)
1213  CandList LJpsiE, LJpsiMu; // J/psi -> ee/mu mu
1214  CandList LEtac, LEtac2; // etac
1215  CandList LDp, LDm, LDp2, LDm2, LDp3, LDm3, LDp4, LDm4; // D+- -> K2pi, K2pipi0, KS pi pi0, KS pi pi pi
1216  CandList LDsp, LDsm, LDsp2, LDsm2; // Ds -> KKpi, KKpipi0
1217  CandList LD0, LD02, LD0b, LD02b, LD03, LD03b; // D0 -> Kpi, Kpipi0, K3pi
1218  CandList LLamcp, LLamcm; // Lc -> pKpi
1219  CandList LLam, LLamb; // Lam -> ppi
1220  CandList Lee; // Lam -> ppi
1221 
1222  int ncomb1=0, ncomb2=0;
1223  bool selected=false;
1224 
1225  for (j=0;j<13;++j) channelselect[j]=false;
1226 
1227  // Apply cut on kaon/lepton multiplicity
1228 /* if ( multcut>0 && (N_K+N_lep<multcut) )
1229  {
1230  mixevts=1;
1231  if (fRand.Rndm()<P_mix) mixevts=2;
1232  continue;
1233  }*/
1234 
1235  evMultCut++;
1236 
1237  bool accepted = false;
1238 
1239  //
1240  // ********* pi0 / KS
1241  //
1242  // *** do combinatorics (pi0 -> gg)
1243  combine(gam, gam, comb1, fPi0Pdg);
1244  fillHisto(comb1, h_pi0, 0, fPi0Mass, fPi0win, h_pi0sel, 0, h_pi0sig );
1245  selectMass(comb1, LPi0, fPi0Mass, fPi0win);
1246 
1247  // *** do combinatorics (pi0 -> gg)
1248  combine(piplus, piminus, comb1, fKsPdg);
1249  fillHisto(comb1, h_ks, 0, fKsMass, fKswin, h_kssel, 0, h_kssig );
1250  selectMass(comb1, LKs, fKsMass, fKswin);
1251 
1252 
1253  // **** cache some eventshape vars
1254  int npart = evsh.NParticles();
1255  int nchrg = evsh.NCharged();
1256  int nneut = evsh.NNeutral();
1257  int npi0 = LPi0.size(); // #pi0 candidates
1258  int nks0 = LKs.size(); // #KS0 candidates
1259  int npi005 = 0.0;
1260  int npi010 = 0.0;
1261  int nks005 = 0.0;
1262  int nks010 = 0.0;
1263  int np05 = evsh.MultPminCms(0.5);
1264  int np10 = evsh.MultPminCms(1.0);
1265 
1266  double pmaxl = evsh.PmaxLab();
1267  double pmax = evsh.PmaxCms();
1268  double pmin = evsh.PminCms();
1269  double ptmax = evsh.Ptmax();
1270 
1271  double sumpc = evsh.ChrgPSumCms();
1272  double sumpc05 = evsh.SumChrgPminCms(0.5);
1273  double sumpt = evsh.PtSumLab();
1274  double sumptc = evsh.ChrgPtSumLab();
1275  double sumptl = sumpt;
1276  double sumen = evsh.NeutESumCms();
1277 
1278  double fw1 = evsh.FoxWolfMomR(1);
1279  double fw2 = evsh.FoxWolfMomR(2);
1280  double fw3 = evsh.FoxWolfMomR(3);
1281  double fw4 = evsh.FoxWolfMomR(4);
1282  double fw5 = evsh.FoxWolfMomR(5);
1283 
1284  // count pi0 with threshold
1285  for (j=0; j<LPi0.size(); ++j)
1286  {
1287  if (LPi0[j].P4().P()>0.5) npi005++;
1288  if (LPi0[j].P4().P()>1.0) npi010++;
1289  }
1290  // count KS with threshold
1291  for (j=0; j<LKs.size(); ++j)
1292  {
1293  if (LKs[j].P4().P()>0.5) nks005++;
1294  if (LKs[j].P4().P()>1.0) nks010++;
1295  }
1296 
1297  h_fw1->Fill(fw2);
1298  h_pmax->Fill(pmax);
1299 
1300 
1301  // **** find out, whether event was accepted
1302 
1303  // ********* PHI -> K+ K-
1304  if ( !evcut
1305  || (sqrts==2.4 && nk>1 && npart<7 && pmax<0.648 )
1306  || (sqrts==3.77 && nk>1 && fw2>0.5456 )
1307  || (sqrts==4.28 && nk>1 && 1 )
1308  || (sqrts==5.0 && nk>1 && 1 )
1309  || (sqrts==5.5 && nk>1 && 1 )
1310  )
1311  {
1312  // *** do combinatorics (phi -> K K)
1313  combine (kplus, kminus, LPhi, fPhiPdg);
1314 
1315  accepted |= eventAccepted(LPhi,fPhiMass, fPhiwin);
1316 
1317  writeTuple("phi",LPhi,evsh, nphi,fPhiMass, fPhiwin);
1318  }
1319 
1320 
1321  // ********* LAMBDA -> p pi-
1322  if ( !evcut
1323  || (sqrts==2.4 && npart>3 && npr>0 && npi>0 && fw1>0.132 && fw4>0.2024 )
1324  || (sqrts==3.77 && npart>3 && pmax>1.056 && fw1>0.0 && fw2>0.6248 && fw5>0.22 )
1325  || (sqrts==4.28 && npart>3 && 1 )
1326  || (sqrts==5.0 && npart>3 && 1 )
1327  || (sqrts==5.5 && npart>3 && 1 )
1328  )
1329  {
1330  // *** do combinatorics (Lam -> p pi)
1331  combine (pplus, piminus, LLam, fLamPdg);
1332  combine (pminus, piplus, LLamb, -fLamPdg);
1333 
1334  accepted |= eventAccepted(LLam, fLamMass, fLamwin);
1335  accepted |= eventAccepted(LLamb, fLamMass, fLamwin);
1336 
1337  writeTuple("lam",LLam,evsh, nlam, fLamMass, fLamwin);
1338  writeTuple("lam",LLamb,evsh, nlam, fLamMass, fLamwin);
1339  }
1340 
1341  // ********* pp -> e+ e-
1342  if ( !evcut
1343  )
1344  {
1345  // *** do combinatorics (e+ e-)
1346  combine(eminus, eplus, Lee, 88880);
1347 
1348  accepted |= eventAccepted(Lee, fIni.M(), feewin);
1349 
1350  writeTuple("ee",Lee,evsh, nee, fIni.M(), feewin);
1351  }
1352 
1353  // ********* ETAC
1354  if ( !evcut
1355 /* || (sqrts==3.77 && np10>1 && npi<4 && pmin<0.3 && sumpc>3.296 )
1356  || (sqrts==4.28 && 1 )
1357  || (sqrts==5.0 && 1 )
1358  || (sqrts==5.5 && 1 )*/
1359  )
1360  {
1361  // *** do combinatorics (ETAC)
1362  combine(LKs, kplus, piminus, LEtac, fEtacPdg);
1363  combine(LKs, kminus, piplus, LEtac2, fEtacPdg);
1364 
1365  accepted |= eventAccepted(LEtac, fEtacMass, fEtacwin);
1366  accepted |= eventAccepted(LEtac2, fEtacMass, fEtacwin);
1367 
1368  writeTuple("etac",LEtac,evsh, netac, fEtacMass, fEtacwin);
1369  writeTuple("etac",LEtac2,evsh, netac, fEtacMass, fEtacwin);
1370  }
1371 
1372  // ********* JPSI -> e+e-
1373  if ( !evcut
1374  || (sqrts==3.77 && np10>1 && npi<4 && pmin<0.3 && sumpc>3.296 )
1375  || (sqrts==4.28 && 1 )
1376  || (sqrts==5.0 && 1 )
1377  || (sqrts==5.5 && 1 )
1378  )
1379  {
1380  // *** do combinatorics (J/psi -> ee)
1381  combine(eminus, eplus, LJpsiE, fJpsiPdg);
1382 
1383  accepted |= eventAccepted(LJpsiE, fJMass, fJwin);
1384 
1385  writeTuple("jpsi1",LJpsiE,evsh, njpsi1, fJMass, fJwin);
1386  }
1387 
1388  // ********* JPSI -> mu+mu-
1389  if ( !evcut
1390  || (sqrts==3.77 && np10>1 && npi<4 && pmin<0.3 && sumpc>3.296 )
1391  || (sqrts==4.28 && 1 )
1392  || (sqrts==5.0 && 1 )
1393  || (sqrts==5.5 && 1 )
1394  )
1395  {
1396  // *** do combinatorics (J/psi -> mu mu)
1397  combine(muminus, muplus, LJpsiMu, fJpsiPdg);
1398 
1399  accepted |= eventAccepted(LJpsiMu, fJMass, fJwin);
1400 
1401  writeTuple("jpsi2",LJpsiMu,evsh, njpsi2, fJMass, fJwin);
1402  }
1403 
1404 
1405  // ********* D+ -> K- pi+ pi+
1406  if ( !evcut
1407  || (sqrts==3.77 && nk>0 && npart<12 && pmax<0.936 && sumpc>1.76 )
1408  || (sqrts==4.28 && nk>0 && 1 )
1409  || (sqrts==5.0 && nk>0 && 1 )
1410  || (sqrts==5.5 && nk>0 && 1 )
1411  )
1412  {
1413  // *** do combinatorics (D+- -> K pi pi)
1414  combine (piplus, piplus, kminus, LDp, fDPdg);
1415  combine (piminus, piminus, kplus, LDm, -fDPdg);
1416 
1417  accepted |= eventAccepted(LDp,fDMass, fDwin);
1418  accepted |= eventAccepted(LDm,fDMass, fDwin);
1419 
1420  writeTuple("d",LDp,evsh, ndpm,fDMass, fDwin);
1421  writeTuple("d",LDm,evsh, ndpm,fDMass, fDwin);
1422  }
1423 
1424 
1425  // ********* D0 -> K- pi+
1426  if ( !evcut
1427  || (sqrts==3.77 && nk>0 && sumpc05>3.18 && pmax>0.768 && pmax<1.056 && fw3<0.1848 )
1428  || (sqrts==4.28 && nk>0 && 1 )
1429  || (sqrts==5.0 && nk>0 && 1 )
1430  || (sqrts==5.5 && nk>0 && 1 )
1431  )
1432  {
1433  // *** do combinatorics (D0 -> K pi)
1434  combine (kplus, piminus, LD0, -fD0Pdg);
1435  combine (kminus, piplus, LD0b, fD0Pdg);
1436 
1437  accepted |= eventAccepted(LD0, fD0Mass, fD0win);
1438  accepted |= eventAccepted(LD0b, fD0Mass, fD0win);
1439 
1440  writeTuple("d0",LD0,evsh, nd0, fD0Mass, fD0win);
1441  writeTuple("d0",LD0b,evsh, nd0, fD0Mass, fD0win);
1442  }
1443 
1444 
1445  // ********* DS -> K+ K- pi+
1446  if ( !evcut
1447  || (sqrts==4.28 && nk>1 && 1 )
1448  || (sqrts==5.0 && nk>1 && 1 )
1449  || (sqrts==5.5 && nk>1 && 1 )
1450  )
1451  {
1452  // *** do combinatorics (Ds+- -> K K pi)
1453  combine (kplus, kminus, piplus, LDsp, fDsPdg);
1454  combine (kplus, kminus, piminus, LDsm, -fDsPdg);
1455 
1456  accepted |= eventAccepted(LDsp, fDsMass, fDswin);
1457  accepted |= eventAccepted(LDsm, fDsMass, fDswin);
1458 
1459  writeTuple("ds",LDsp,evsh, nds, fDsMass, fDswin);
1460  writeTuple("ds",LDsm,evsh, nds, fDsMass, fDswin);
1461  }
1462 
1463 
1464  // ********* LAMBDA_C -> p K- pi+
1465  if ( !evcut
1466  || (sqrts==5.0 && 1 )
1467  || (sqrts==5.5 && 1 )
1468  )
1469  {
1470  // *** do combinatorics (Lamc)
1471  combine (pplus, kminus, piplus, LLamcp, fLamcPdg);
1472  combine (pminus, kplus, piminus, LLamcm, -fLamcPdg);
1473 
1474  accepted |= eventAccepted(LLamcp, fLamcMass, fLamcwin);
1475  accepted |= eventAccepted(LLamcm, fLamcMass, fLamcwin);
1476 
1477  writeTuple("lamc",LLamcp,evsh, nlamc, fLamcMass, fLamcwin);
1478  writeTuple("lamc",LLamcm,evsh, nlamc, fLamcMass, fLamcwin);
1479  }
1480 
1481 
1482  // ********* NOW do counting and drawing, ONLY for events which are accepted by any selector
1483  // {"Phi(KK)", "ee", "Lam(ppi)", "etac", "J/psi(ee)","J/psi(mumu)","D+-(K2pi)", "D0(Kpi)","Ds(KKpi)","Lamc(pKpi)"};
1484  // 0 1 2 3 4 5 6 7 8 9
1485  if (!simcut || accepted)
1486  {
1487  // **** Phi
1488  if (sqrts>2.2)
1489  {
1490  ncomb1 = fillHisto(LPhi, h_phi, 0, fPhiMass, fPhiwin, h_phisel, 0, h_phisig );
1491  combCnt += ncomb1;
1492  if (ncomb1>0) {selected=true; channelselect[0]=true;}
1493  }
1494 
1495  // **** ee
1496  if (sqrts>2.2)
1497  {
1498  ncomb1 = fillHisto(Lee, h_ee, 0, fIni.M(), feewin, h_eesel, 0, h_eesig );
1499  combCnt += ncomb1;
1500  if (ncomb1>0) {selected=true; channelselect[1]=true;}
1501  }
1502 
1503  // **** Lam
1504  if (sqrts>2.2)
1505  {
1506  ncomb1 = fillHisto(LLam, h_lam, 0, fLamMass, fLamwin, h_lamsel, 0, h_lamsig );
1507  ncomb2 = fillHisto(LLamb, h_lam, 0, fLamMass, fLamwin, h_lamsel, 0, h_lamsig );
1508  combCnt += ncomb1 + ncomb2;
1509  if (ncomb1>0 || ncomb2>0) {selected=true; channelselect[2]=true;}
1510  }
1511 
1512  // **** etac
1513  if (sqrts>3.1)
1514  {
1515  ncomb1 = fillHisto(LEtac, h_etac, 0, fEtacMass, fEtacwin, h_etacsel, 0, h_etacsig );
1516  ncomb2 = fillHisto(LEtac2, h_etac, 0, fEtacMass, fEtacwin, h_etacsel, 0, h_etacsig );
1517  combCnt += ncomb1 + ncomb2;
1518  if (ncomb1>0 || ncomb2>0 ) {selected=true; channelselect[3]=true;}
1519  }
1520 
1521  // **** J/psi ee
1522  if (sqrts>3.1)
1523  {
1524  ncomb1 = fillHisto(LJpsiE, h_jpsi, 0, fJMass, fJwin, h_jpsisel, 0, h_jpsisig );
1525  combCnt += ncomb1;
1526  if (ncomb1>0 ) {selected=true; channelselect[4]=true;}
1527  }
1528 
1529  // **** J/psi mumu
1530  if (sqrts>3.1)
1531  {
1532  ncomb1 = fillHisto(LJpsiMu, h_jpsi2, 0, fJMass, fJwin, h_jpsi2sel, 0, h_jpsi2sig );
1533  combCnt += ncomb1 ;
1534  if (ncomb1>0 ) {selected=true; channelselect[5]=true;}
1535  }
1536 
1537  // **** Dp
1538  if (sqrts>3.75)
1539  {
1540  ncomb1 = fillHisto(LDp, h_dpm, 0, fDMass, fDwin, h_dpmsel, 0, h_dpmsig );
1541  ncomb2 = fillHisto(LDm, h_dpm, 0, fDMass, fDwin, h_dpmsel, 0, h_dpmsig );
1542  combCnt += ncomb1 +ncomb2;
1543  if (ncomb1>0 || ncomb2>0) {selected=true; channelselect[6]=true;}
1544  }
1545 
1546  // **** D0
1547  if (sqrts>3.75)
1548  {
1549  ncomb1 = fillHisto(LD0, h_d0, 0, fD0Mass, fD0win, h_d0sel, 0, h_d0sig );
1550  ncomb2 = fillHisto(LD0b, h_d0, 0, fD0Mass, fD0win, h_d0sel, 0, h_d0sig );
1551  combCnt += ncomb1 +ncomb2;
1552  if (ncomb1>0 || ncomb2>0) {selected=true; channelselect[7]=true;}
1553  }
1554 
1555  // **** Ds
1556  if (sqrts>4.)
1557  {
1558  ncomb1 = fillHisto(LDsp, h_ds, 0, fDsMass, fDswin, h_dssel, 0, h_dssig );
1559  ncomb2 = fillHisto(LDsm, h_ds, 0, fDsMass, fDswin, h_dssel, 0, h_dssig );
1560  combCnt += ncomb1 +ncomb2;
1561  if (ncomb1>0 || ncomb2>0) {selected=true; channelselect[8]=true;}
1562  }
1563 
1564  // **** Lamc
1565  if (sqrts>4.57)
1566  {
1567  ncomb1 = fillHisto(LLamcp, h_lamc, 0, fLamcMass, fLamcwin, h_lamcsel, 0, h_lamcsig );
1568  ncomb2 = fillHisto(LLamcm, h_lamc, 0, fLamcMass, fLamcwin, h_lamcsel, 0, h_lamcsig );
1569  combCnt += ncomb1 + ncomb2;
1570  if (ncomb1>0 || ncomb2>0) {selected=true; channelselect[9]=true;}
1571  }
1572  }
1573  // ****************
1574 
1575  if (selected) evCnt+=mixevts; // *** if any combination is in window count event
1576 
1577  for (j=0;j<10;++j) if (channelselect[j]) channelcount[j]+=mixevts;
1578 
1579  //hmix->Fill(mixevts);
1580  // new round of mixing
1581  mixevts=1;
1582  if (fRand.Rndm()<P_mix) mixevts=2;
1583 
1584  //if (i<3) printAllLists();
1585  }
1586  //cout <<"cntInLam "<<cntInLam<<endl;
1587  cout<< "#Combinations:"<<combCnt<<" #Events:"<<evCnt<<" ";
1588  cout <<"Efficiency (ev):"<<(double)evCnt/(double)nev<<endl;
1589  cout <<"Mult Cut Eff (ev):"<<(double)evMultCut/(double)nev<<endl;
1590 
1591  for (i=0;i<10;++i)
1592  {
1593  channelcount[i]/=nev;
1594  cout <<channelname[i]<<":"<<channelcount[i]<<endl;
1595  }
1596  cout <<endl;
1597 
1598  TLatex latex;
1599  latex.SetTextSize(0.08);
1600  char tmp[200];
1601  double offset = 0.1;
1602  double pos=3.3, pos2=1.85;
1603  double hfac = 0.75;
1604  // *** plot all stuff and write out info
1605  c1->cd(1); h_pi0->Draw(); h_pi0sel->Draw("same"); h_pi0sig->Draw("same");
1606  c1->cd(2); h_ks->Draw(); h_kssel->Draw("same"); h_kssig->Draw("same");
1607 
1608  c2->cd(1); h_phi->Draw(); h_phisel->Draw("same"); h_phisig->Draw("same");
1609  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[0]*100.);
1610  latex.DrawLatex(pos2,h_phi->GetMaximum()*hfac+offset,tmp);
1611 
1612  c2->cd(2); h_ee->Draw(); h_eesel->Draw("same"); h_eesig->Draw("same");
1613  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[1]*100.);
1614  latex.DrawLatex(pos*1.2,h_ee->GetMaximum()*hfac+offset,tmp);
1615 
1616  c2->cd(3); h_lam->Draw(); h_lamsel->Draw("same"); h_lamsig->Draw("same");
1617  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[2]*100.);
1618  latex.DrawLatex(pos2,h_lam->GetMaximum()*hfac+offset,tmp);
1619 
1620  c2->cd(4); h_etac->Draw(); h_etacsel->Draw("same"); h_etacsig->Draw("same");
1621  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[3]*100.);
1622  latex.DrawLatex(pos,h_etac->GetMaximum()*hfac+offset,tmp);
1623 
1624  c2->cd(5); h_jpsi->Draw(); h_jpsisel->Draw("same"); h_jpsisig->Draw("same");
1625  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[4]*100.);
1626  latex.DrawLatex(pos,h_jpsi->GetMaximum()*hfac+offset,tmp);
1627 
1628  c2->cd(6); h_jpsi2->Draw(); h_jpsi2sel->Draw("same"); h_jpsi2sig->Draw("same");
1629  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[5]*100.);
1630  latex.DrawLatex(pos,h_jpsi2->GetMaximum()*hfac+offset,tmp);
1631 
1632  c2->cd(7); h_dpm->Draw(); h_dpmsel->Draw("same"); h_dpmsig->Draw("same");
1633  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[6]*100.);
1634  latex.DrawLatex(pos,h_dpm->GetMaximum()*hfac+offset,tmp);
1635 
1636  c2->cd(8); h_d0->Draw(); h_d0sel->Draw("same"); h_d0sig->Draw("same");
1637  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[7]*100.);
1638  latex.DrawLatex(pos,h_d0->GetMaximum()*hfac+offset,tmp);
1639 
1640  c2->cd(9); h_ds->Draw(); h_dssel->Draw("same"); h_dssig->Draw("same");
1641  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[8]*100.);
1642  latex.DrawLatex(pos,h_ds->GetMaximum()*hfac+offset,tmp);
1643 
1644  c2->cd(10); h_lamc->Draw(); h_lamcsel->Draw("same"); h_lamcsig->Draw("same");
1645  sprintf(tmp,"#epsilon = %4.1f%%",channelcount[9]*100.);
1646  latex.DrawLatex(pos,h_lamc->GetMaximum()*hfac+offset,tmp);
1647 
1648  // total efficiency in first plot (phi)
1649  c2->cd(5);
1650  double posy = h_jpsi->GetMaximum()*1.12;
1651  if (posy=0) posy=1.12;
1652  sprintf(tmp,"(#epsilon_{t} = %4.1f%%)",double(evCnt)/double(nev)*100.);
1653  latex.SetTextColor(kMagenta+2);
1654  latex.DrawLatex(3.0,h_jpsi->GetMaximum()*1.12,tmp);
1655 
1656 
1657  //sprintf(tmp,"#epsilon = %4.1f%%",channelcount[6]*100.);
1658  //latex.DrawLatex(2.5,h_pi0->GetMaximum()*0.95,tmp);
1659 
1660 /* c2->cd();
1661  TPad *peff=new TPad("peff","peff",0.45,0.47,0.55,0.53);
1662  peff->Draw();
1663  peff->cd();
1664  sprintf(tmp,"#epsilon_{tot} = %4.1f%%",double(evCnt)/double(nev)*100.);
1665  latex.SetTextSize(0.5);
1666  latex.SetTextColor(2);
1667  latex.DrawLatex(0.1,0.3,tmp);
1668  */
1669  c2->cd();
1670 
1671  h_mult_klep->Scale(1.0/nev);
1672 
1673  TString plotname(fsig(fsig.Index("/")+1,fsig.Length()-5));
1674 
1675  c2->SaveAs("fig/"+plotname+"_core.gif");
1676  c2->SaveAs("fig/"+plotname+"_core.pdf");
1677 
1678  if (writentp)
1679  {
1680  fn->Write();
1681  fn->Close();
1682  }
1683 
1684  return 0;
1685 }
void selectMass(CandList &in, CandList &out, double mmean=0, double mw=0)
Definition: toy_core.C:628
CandList recolist
Definition: toy_core.C:135
TVector3 pos
bool eventAccepted(CandList &l, double m=0, double w=0)
Definition: toy_core.C:320
int globmode
Definition: toy_core.C:124
double fEtacwin
Definition: toy_core.C:98
int fPhiPdg
Definition: toy_core.C:90
double fD0Mass
Definition: toy_core.C:65
CandList gam
Definition: toy_core.C:138
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TString plotname[10]
Definition: full_core_ntp.C:44
void makePidSelection(CandList &l)
Definition: toy_core.C:676
int fPi0Pdg
Definition: toy_core.C:49
int fDsPdg
Definition: toy_core.C:85
double fDsig
Definition: toy_core.C:61
double fLamsig
Definition: toy_core.C:82
void boostList(CandList &list, CandList &boostlist, TVector3 boost)
Definition: toy_core.C:164
int nk
Definition: toy_core.C:124
int npr
Definition: toy_core.C:124
double fDsMass
Definition: toy_core.C:86
int fD0Pdg
Definition: toy_core.C:64
double fPhisig
Definition: toy_core.C:92
CandList pplus
Definition: toy_core.C:138
int fLamcPdg
Definition: toy_core.C:100
int ev
CandList muplus
Definition: toy_core.C:138
double fEtacMass
Definition: toy_core.C:96
TDatabasePDG * pdg_db
Definition: toy_core.C:130
int evtno
Definition: toy_core.C:124
double fKssig
Definition: toy_core.C:57
c2
Definition: plot_dirc.C:39
double fPhiMass
Definition: toy_core.C:91
int fKsPdg
Definition: toy_core.C:54
double fLamcMass
Definition: toy_core.C:101
double fEtacsig
Definition: toy_core.C:97
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
TVector3 offset(2, 0, 0)
TRandom3 fRand
Definition: toy_core.C:28
int fillHisto(CandList &l, TH1 *hall, TH1 *hbg=0, double m=0, double w=0, TH1 *hallsel=0, TH1 *hbgsel=0, TH1 *hsig=0, TH1 *hmm=0, TH2 *hmvsmm=0)
Definition: toy_core.C:337
CandList recocmslist
Definition: toy_core.C:135
std::vector< SimpleCand > CandList
Definition: SimpleCand.C:76
double fDswin
Definition: toy_core.C:88
double high
Definition: toy_core.C:35
void writeTuple(TString pre, CandList &l, EventShape &evsh, SimpleNtp *n, double mass, double win)
Definition: toy_core.C:781
Double_t p
Definition: anasim.C:58
TLorentzVector fIni
Definition: toy_core.C:29
for(int j=0;j< ncounts;j++)
int nbins
Definition: toy_core.C:33
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
CandList kminus
Definition: toy_core.C:138
Int_t mode
Definition: autocutx.C:47
double fLamMass
Definition: toy_core.C:81
double fLamcsig
Definition: toy_core.C:102
CandList piplus
Definition: toy_core.C:138
double fPhiwin
Definition: toy_core.C:93
int ne
Definition: toy_core.C:124
int nsigpiks
Definition: toy_core.C:44
double fDMass
Definition: toy_core.C:60
double fPi0sig
Definition: toy_core.C:52
Double_t
double fKsMass
Definition: toy_core.C:55
double feewin
Definition: toy_core.C:78
CandList eplus
Definition: toy_core.C:138
int combine(CandList &l1, CandList &l2, CandList &out, int matchPdg=0)
Definition: toy_core.C:363
int fEtacPdg
Definition: toy_core.C:95
CandList pminus
Definition: toy_core.C:138
CandList eminus
Definition: toy_core.C:138
CandList mcFSlist
Definition: toy_core.C:135
TFile * f
Definition: bump_analys.C:12
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
double fDwin
Definition: toy_core.C:62
c1
Definition: plot_dirc.C:35
double fJMass
Definition: toy_core.C:70
CandList mclist
Definition: toy_core.C:135
void makeIni4Vector(TLorentzVector &l, double s)
Definition: toy_core.C:697
double fD0sig
Definition: toy_core.C:66
int nlep
Definition: toy_core.C:124
double fDssig
Definition: toy_core.C:87
int fJpsiPdg
Definition: toy_core.C:69
void init(double pideff, double misid)
Definition: toy_core.C:235
CandList kplus
Definition: toy_core.C:138
double feesigconst
Definition: toy_core.C:76
int nsig
Definition: toy_core.C:46
void configHisto(TH1 *h)
Definition: toy_core.C:704
void setStyle()
Definition: toy_core.C:141
double fLamcwin
Definition: toy_core.C:103
double fD0win
Definition: toy_core.C:67
double fPi0win
Definition: toy_core.C:51
double fLamwin
Definition: toy_core.C:83
double fJsig
Definition: toy_core.C:71
TTree * t
Definition: bump_analys.C:13
int fLamPdg
Definition: toy_core.C:80
double feesigslope
Definition: toy_core.C:77
double fKswin
Definition: toy_core.C:56
bool isFinalState(int n)
Definition: toy_core.C:180
void makeRecoCands(CandList &mc, CandList &reco, double eff=0.90, double dp=0.05, double dtht=0.001, double dphi=0.001)
Definition: toy_core.C:594
double fJwin
Definition: toy_core.C:72
int fDPdg
Definition: toy_core.C:59
CandList muminus
Definition: toy_core.C:138
int nmu
Definition: toy_core.C:124
double pz[39]
Definition: pipisigmas.h:14
CandList piminus
Definition: toy_core.C:138
double fPi0Mass
Definition: toy_core.C:50
int npi
Definition: toy_core.C:124
const string filename
const int fMAX
Definition: toy_core.C:32
void writeTuple ( TString  pre,
CandList l,
EventShape evsh,
SimpleNtp n,
double  mass,
double  win 
)

Definition at line 781 of file toy_core.C.

References EventShape::Aplanarity(), EventShape::ChrgPSumCms(), EventShape::ChrgPtSumLab(), EventShape::Circularity(), SimpleNtp::Column(), d, SimpleNtp::DumpData(), evtno, fabs(), EventShape::FoxWolfMomR(), globmode, i, EventShape::NCharged(), ne, nk, nmu, EventShape::NNeutral(), EventShape::NParticles(), npi, npr, EventShape::Planarity(), EventShape::PmaxCms(), EventShape::PmaxLab(), EventShape::PminCms(), EventShape::Ptmax(), EventShape::PtSumLab(), qaCand(), EventShape::Sphericity(), tag, and EventShape::Thrust().

Referenced by toy_core().

782 {
783  int dauidx[32];
784  for (int i=0;i<l.size();++i)
785  {
786  qaCand(pre,l[i], n);
787  float tag = 0;
788  float mct = l[i].Mct();
789 
790  if (fabs(l[i].P4().M()-mass)<win) tag=1.0;
791 
792  n->Column("tag",tag);
793  n->Column("mct",mct);
794 
795  //int nDau = getDauIdx(l[i], dauidx);
796 
797  //cout <<"c("<<l[i].Marker()<<") "<<i<<" made from ";
798  for (int j=0;j<l[i].NDau();++j)
799  {
800  //cout <<dauidx[j]<<" ";
801  //SimpleCand d = recolist[dauidx[j]];
802  SimpleCand d=*(l[i].Dau(j));
803  qaCand(TString::Format("%sd%d",pre.Data(),j),d, n);
804  }
805  //cout <<endl;
806 
807  n->Column("evt", evtno);
808  n->Column("mode", globmode);
809 
810  // store eventshape
811  n->Column("npart", evsh.NParticles());
812  n->Column("nneut", evsh.NNeutral());
813  n->Column("nchrg", evsh.NCharged());
814  n->Column("sumpc", evsh.ChrgPSumCms());
815  n->Column("sumpt", evsh.PtSumLab());
816  n->Column("sumptc", evsh.ChrgPtSumLab());
817  n->Column("pmaxl" ,evsh.PmaxLab());
818  n->Column("pmax", evsh.PmaxCms());
819  n->Column("pmin", evsh.PminCms());
820  n->Column("ptmax",evsh.Ptmax());
821  n->Column("thr", evsh.Thrust());
822  n->Column("pla", evsh.Planarity());
823  n->Column("apl", evsh.Aplanarity());
824  n->Column("sph", evsh.Sphericity());
825  n->Column("cir", evsh.Circularity());
826  n->Column("ne", ne);
827  n->Column("nmu", nmu);
828  n->Column("npi", npi);
829  n->Column("nk", nk);
830  n->Column("npr", npr);
831  n->Column("fw1", evsh.FoxWolfMomR(1));
832  n->Column("fw2", evsh.FoxWolfMomR(2));
833  n->Column("fw3", evsh.FoxWolfMomR(3));
834  n->Column("fw4", evsh.FoxWolfMomR(4));
835  n->Column("fw5", evsh.FoxWolfMomR(5));
836 
837  n->DumpData();
838  }
839 }
int globmode
Definition: toy_core.C:124
int NNeutral() const
Definition: EventShape.h:17
TObjArray * d
Int_t i
Definition: run_full.C:25
int NCharged() const
Definition: EventShape.h:16
int nk
Definition: toy_core.C:124
int npr
Definition: toy_core.C:124
Int_t tag
Definition: crosstag.C:23
int NParticles() const
Definition: EventShape.h:15
double Aplanarity()
Definition: EventShape.h:299
int evtno
Definition: toy_core.C:124
double PmaxLab() const
Definition: EventShape.h:20
double PtSumLab() const
Definition: EventShape.h:29
void qaCand(TString pre, SimpleCand &c, SimpleNtp *n)
Definition: toy_core.C:714
int ne
Definition: toy_core.C:124
double PminCms() const
Definition: EventShape.h:23
double Sphericity()
Definition: EventShape.h:281
double Circularity()
Definition: EventShape.h:308
double Planarity()
Definition: EventShape.h:290
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
double ChrgPSumCms() const
Definition: EventShape.h:40
double Thrust()
Definition: EventShape.h:324
double FoxWolfMomR(int order)
Definition: EventShape.h:462
double PmaxCms() const
Definition: EventShape.h:21
double ChrgPtSumLab() const
Definition: EventShape.h:32
void Column(TString name, Float_t value)
Definition: SimpleNtp.C:33
int nmu
Definition: toy_core.C:124
void DumpData()
Definition: SimpleNtp.C:23
double Ptmax() const
Definition: EventShape.h:24
int npi
Definition: toy_core.C:124

Variable Documentation

CandList eminus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList eplus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

int evtno

Definition at line 124 of file toy_core.C.

Referenced by toy_core(), and writeTuple().

TF1* f_res =0

Definition at line 123 of file toy_core.C.

Referenced by dponline(), and init().

double fD0Mass = 1.8645

Definition at line 65 of file toy_core.C.

Referenced by toy_core().

int fD0Pdg = 421

Definition at line 64 of file toy_core.C.

Referenced by toy_core().

double fD0sig = 0.055

Definition at line 66 of file toy_core.C.

Referenced by toy_core().

double fD0win =0.25

Definition at line 67 of file toy_core.C.

Referenced by toy_core().

const double fdE = 0.05

Definition at line 39 of file toy_core.C.

Referenced by makeRecoCands().

double fDMass = 1.8693

Definition at line 60 of file toy_core.C.

Referenced by toy_core().

int fDPdg = 411

Definition at line 59 of file toy_core.C.

Referenced by toy_core().

double fDsig = 0.045

Definition at line 61 of file toy_core.C.

Referenced by toy_core().

double fDsMass = 1.9686

Definition at line 86 of file toy_core.C.

Referenced by toy_core().

int fDsPdg = 431

Definition at line 85 of file toy_core.C.

Referenced by toy_core().

double fDssig = 0.04

Definition at line 87 of file toy_core.C.

Referenced by toy_core().

double fDswin =0.2

Definition at line 88 of file toy_core.C.

Referenced by toy_core().

double fDwin =0.25

Definition at line 62 of file toy_core.C.

Referenced by toy_core().

double feeMass = 0

Definition at line 75 of file toy_core.C.

int feePdg = 88880

Definition at line 74 of file toy_core.C.

double feesigconst = 0.0024

Definition at line 76 of file toy_core.C.

Referenced by toy_core().

double feesigslope = 0.036

Definition at line 77 of file toy_core.C.

Referenced by toy_core().

double feewin = 0.

Definition at line 78 of file toy_core.C.

Referenced by toy_core().

double fEtacMass = 2.9798

Definition at line 96 of file toy_core.C.

Referenced by toy_core().

int fEtacPdg = 441

Definition at line 95 of file toy_core.C.

Referenced by toy_core().

double fEtacsig = 0.08

Definition at line 97 of file toy_core.C.

Referenced by toy_core().

double fEtacwin =0.15

Definition at line 98 of file toy_core.C.

Referenced by toy_core().

TLorentzVector fIni

Definition at line 29 of file toy_core.C.

Referenced by fillHisto(), qaCand(), and toy_core().

double fJMass = 3.09687

Definition at line 70 of file toy_core.C.

Referenced by toy_core().

int fJpsiPdg = 443

Definition at line 69 of file toy_core.C.

Referenced by toy_core().

double fJsig = 0.11

Definition at line 71 of file toy_core.C.

Referenced by toy_core().

double fJwin =0.7

Definition at line 72 of file toy_core.C.

Referenced by toy_core().

double fKsMass = 0.497614

Definition at line 55 of file toy_core.C.

Referenced by toy_core().

int fKsPdg = 310

Definition at line 54 of file toy_core.C.

Referenced by toy_core().

double fKssig = 0.012

Definition at line 57 of file toy_core.C.

Referenced by toy_core().

double fKswin = 0.025

Definition at line 56 of file toy_core.C.

Referenced by toy_core().

double fLamcMass = 2.2849

Definition at line 101 of file toy_core.C.

Referenced by toy_core().

int fLamcPdg = 4122

Definition at line 100 of file toy_core.C.

Referenced by toy_core().

double fLamcsig = 0.035

Definition at line 102 of file toy_core.C.

Referenced by toy_core().

double fLamcwin =0.2

Definition at line 103 of file toy_core.C.

Referenced by toy_core().

double fLamMass = 1.115684

Definition at line 81 of file toy_core.C.

Referenced by toy_core().

int fLamPdg = 3122

Definition at line 80 of file toy_core.C.

Referenced by toy_core().

double fLamsig = 0.0042

Definition at line 82 of file toy_core.C.

Referenced by toy_core().

double fLamwin =0.1

Definition at line 83 of file toy_core.C.

Referenced by toy_core().

const int fMAX = 100

Definition at line 32 of file toy_core.C.

Referenced by toy_core().

const double fNdphi = 0.003

Definition at line 41 of file toy_core.C.

Referenced by makeRecoCands().

const double fNdtht = 0.003

Definition at line 40 of file toy_core.C.

Referenced by makeRecoCands().

const double fNeutEff = 0.95

Definition at line 38 of file toy_core.C.

Referenced by makeRecoCands().

double fPhiMass = 1.0195

Definition at line 91 of file toy_core.C.

Referenced by toy_core().

int fPhiPdg = 333

Definition at line 90 of file toy_core.C.

Referenced by toy_core().

double fPhisig = 0.0065

Definition at line 92 of file toy_core.C.

Referenced by toy_core().

double fPhiwin =0.2

Definition at line 93 of file toy_core.C.

Referenced by toy_core().

double fPi0Mass = 0.13497

Definition at line 50 of file toy_core.C.

Referenced by toy_core().

int fPi0Pdg = 111

Definition at line 49 of file toy_core.C.

Referenced by toy_core().

double fPi0sig = 0.0055

Definition at line 52 of file toy_core.C.

Referenced by toy_core().

double fPi0win = 0

Definition at line 51 of file toy_core.C.

Referenced by toy_core().

TRandom3 fRand

Definition at line 28 of file toy_core.C.

Referenced by isDetected(), select(), smearMom(), and toy_core().

CandList gam

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

int globmode

Definition at line 124 of file toy_core.C.

Referenced by toy_core(), and writeTuple().

double high = 6.0

Definition at line 35 of file toy_core.C.

Referenced by toy_core().

CandList kminus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList kplus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

double low = 0.0

Definition at line 34 of file toy_core.C.

CandList mcFSlist

Definition at line 135 of file toy_core.C.

Referenced by toy_core().

CandList mclist

Definition at line 135 of file toy_core.C.

Referenced by combine(), printAllLists(), and toy_core().

double mE

Definition at line 121 of file toy_core.C.

Referenced by init(), and makePidSelection().

double mK

Definition at line 121 of file toy_core.C.

Referenced by init(), and makePidSelection().

double mMu

Definition at line 121 of file toy_core.C.

Referenced by init(), and makePidSelection().

double mP

Definition at line 121 of file toy_core.C.

Referenced by init(), makeIni4Vector(), and makePidSelection().

double mPi

Definition at line 121 of file toy_core.C.

Referenced by init(), and makePidSelection().

double mPi0

Definition at line 121 of file toy_core.C.

Referenced by init().

CandList muminus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList muplus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

int nbins = 300

Definition at line 33 of file toy_core.C.

Referenced by toy_core().

int ne

Definition at line 124 of file toy_core.C.

Referenced by toy_core(), and writeTuple().

int nk

Definition at line 124 of file toy_core.C.

Referenced by PndLmdTrkQTask::Exec(), main(), softtrigger_toy12(), toy_core(), and writeTuple().

int nlep

Definition at line 124 of file toy_core.C.

Referenced by softtrigger_toy12(), and toy_core().

int nmu

Definition at line 124 of file toy_core.C.

Referenced by toy_core(), and writeTuple().

int npi
int npr

Definition at line 124 of file toy_core.C.

Referenced by softtrigger_toy12(), toy_core(), and writeTuple().

int nsig = 8
int nsigpiks = 5

Definition at line 44 of file toy_core.C.

Referenced by toy_core().

TDatabasePDG* pdg_db

Definition at line 130 of file toy_core.C.

Referenced by init(), select(), and toy_core().

std::map<int,int> pdgidx

Definition at line 128 of file toy_core.C.

Referenced by init(), and select().

double pidreal[25]
Initial value:
= { 95, 6, 10, 7, 10,
5, 86, 27, 6, 7,
9, 29, 85, 18, 16,
9, 21, 40, 67, 24,
12, 12, 20, 16, 90 }

Definition at line 114 of file toy_core.C.

double pidtab[25]
Initial value:
= { 80, 5, 5, 5, 5,
5, 80, 5, 5, 5,
5, 5, 80, 5, 5,
5, 5, 5, 80, 5,
5, 5, 5, 5, 80 }

Definition at line 107 of file toy_core.C.

Referenced by makePidTable(), and select().

CandList piminus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList piplus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList pminus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList pplus

Definition at line 138 of file toy_core.C.

Referenced by makePidSelection(), printAllLists(), and toy_core().

CandList recocmslist

Definition at line 135 of file toy_core.C.

Referenced by toy_core().

CandList recolist

Definition at line 135 of file toy_core.C.

Referenced by printAllLists(), and toy_core().