13 #include "TDatabasePDG.h" 20 #include "TGScrollBar.h" 21 #include "TGTextBuffer.h" 22 #include "TGTextView.h" 23 #include "TParticle.h" 24 #include "TParticlePDG.h" 26 #include "RQ_OBJECT.h" 56 evdb::ObjListCanvas(mf),
59 fBigFrame(
new TGHorizontalFrame(mf, 40, 20)),
60 fL1(kLHintsLeft|kLHintsTop|kLHintsExpandX, 2, 2, 2, 2),
61 fL2(kLHintsLeft, 4, 4, 4, 4),
62 fL3(kLHintsRight, 4, 4, 4, 4),
63 fL4(kLHintsLeft|kLHintsExpandY, 4, 4, 4, 4),
64 fL5(kLHintsLeft|kLHintsExpandY|kLHintsExpandX, 0, 0, 2, 2),
65 fScrollBar(
new TGVScrollBar(fBigFrame, 80, 5)),
66 fShowFrame(
new TGHorizontalFrame(mf, 20, 20)),
67 fShowPositive(
new TGCheckButton(fShowFrame,
"Positives")),
68 fShowNegative(
new TGCheckButton(fShowFrame,
"Negatives")),
69 fShowNeutral(
new TGCheckButton(fShowFrame,
"Neutrals")),
70 fSim(0), fRaw(0), fReco(0)
76 const char* gsPanelTitle[
kNPanel] = {
87 const char* gsFuncName[
kNPanel] = {
100 this,
"UpdateAndDraw()");
102 this,
"UpdateAndDraw()");
104 this,
"UpdateAndDraw()");
110 fScrollBar->Connect(
"ProcessedEvent(Event_t*)",
"evd::MCTrueView",
this,
111 "HandleMouseWheel(Event_t*)");
118 this, gsFuncName[i]);
139 fDrawCheck[
i]->Connect(
"Clicked()",
"evd::MCTrueView",
this,
"HiLite()");
176 std::vector< std::vector< const sim::FLSHitList*> > fHitList;
189 TParticlePDG*
pdg = TDatabasePDG::Instance()->GetParticle(ipdg);
191 q = (
int)pdg->Charge();
192 mom =
sqrt(p->
E()*p->
E()-pdg->Mass()*pdg->Mass());
196 gsPartList.push_back(*p);
201 gsPartTime[p->
TrackId()] = 9.e9;
206 for (
unsigned int iv=0; iv<fHitList.size(); ++iv) {
207 for (
unsigned int i=0;
i<fHitList[iv].size(); ++
i) {
208 for (
unsigned int j=0;
j<fHitList[iv][
i]->fHits.size(); ++
j) {
210 for (
unsigned int ii=0; ii<gsPartList.size(); ++ii) {
211 if (hit.
GetTrackID() == gsPartList[ii].TrackId()) {
212 int id = gsPartList[ii].TrackId();
236 for (
unsigned int i=0;
i<gsPartList.size(); ++
i) {
275 int npart = gsPartList.size();
282 if (imin < 0) imin = 0;
286 for (
int i=0;
i<imax; ++
i) {
302 sprintf(buff,
"%d",p.
Mother());
305 sprintf(buff,
"%d",p.
TrackId());
308 sprintf(buff,
"%6.4f",p.
P());
311 sprintf(buff,
"%6.4f",p.
Vz());
314 sprintf(buff,
"%d",gsNFLSHit[p.
TrackId()]);
317 sprintf(buff,
"%6.4g",gsPartTime[p.
TrackId()]);
320 sprintf(buff,
"%6.4f",gsPartEDep[p.
TrackId()]);
348 static bool fwd =
true;
350 sort(gsPartList.begin(), gsPartList.end(),
CompParticle);
354 sort(gsPartList.rbegin(), gsPartList.rend(),
CompParticle);
373 static bool fwd =
true;
375 sort(gsPartList.begin(), gsPartList.end(),
CompMother);
379 sort(gsPartList.rbegin(), gsPartList.rend(),
CompMother);
398 static bool fwd =
true;
400 sort(gsPartList.begin(), gsPartList.end(),
CompMomentum);
404 sort(gsPartList.rbegin(), gsPartList.rend(),
CompMomentum);
421 static bool fwd =
true;
423 sort(gsPartList.begin(), gsPartList.end(),
CompTrackId);
427 sort(gsPartList.rbegin(), gsPartList.rend(),
CompTrackId);
444 static bool fwd =
true;
446 sort(gsPartList.begin(), gsPartList.end(),
CompVtxZ);
450 sort(gsPartList.rbegin(), gsPartList.rend(),
CompVtxZ);
462 return (a.
Vz() < b.
Vz());
469 static bool fwd =
true;
471 sort(gsPartList.begin(), gsPartList.end(),
CompNHit);
475 sort(gsPartList.rbegin(), gsPartList.rend(),
CompNHit);
494 static bool fwd =
true;
496 sort(gsPartList.begin(), gsPartList.end(),
CompTime);
500 sort(gsPartList.rbegin(), gsPartList.rend(),
CompTime);
519 static bool fwd =
true;
521 sort(gsPartList.begin(), gsPartList.end(),
CompEDep);
525 sort(gsPartList.rbegin(), gsPartList.rend(),
CompEDep);
556 int npart = gsPartList.size();
558 if (imin < 0) imin = 0;
562 for (
int i=0;
i<imax; ++
i) {
double E(const int i=0) const
::xsd::cxx::tree::id< char, ncname > id
TGVScrollBar * fScrollBar
TGCompositeFrame * fBigFrame
static bool CompTime(const sim::Particle &a, const sim::Particle &b)
back track the reconstruction to the simulation
A window that gives full list of MC particles, allowing user to turn hits on and off in other views...
TGCompositeFrame * fPartFrame[kNPanel]
void HiLite(int trkId, bool hlt=true)
Aid in the rendering of RecoBase objects.
static std::map< int, float > gsPartEDep
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Drawing pad for short summary of an MC event.
TGCheckButton * fShowNegative
static std::map< int, float > gsPartMom
list_type::const_iterator const_iterator
TGCompositeFrame * fShowFrame
A single unit of energy deposition in the liquid scintillator.
static std::map< int, int > gsCharge
Manage all things related to colors for the event display.
static bool CompMomentum(const sim::Particle &a, const sim::Particle &b)
static std::map< int, float > gsPartTime
std::vector< int > fPartList
static bool CompParticle(const sim::Particle &a, const sim::Particle &b)
void Draw(const char *opt="u")
MCTrueView(TGMainFrame *mf)
static bool CompNHit(const sim::Particle &a, const sim::Particle &b)
static std::vector< sim::Particle > gsPartList
double P(const int i=0) const
int ColorFromPDG(int pdgcode)
static std::map< int, bool > gsHiLite
TGTextButton * fColumnLabel[kNPanel]
Class to aid in the rendering of RecoBase objects.
static bool CompEDep(const sim::Particle &a, const sim::Particle &b)
TGLabel * fPartLabel[kNPanel][kNPart]
Class to aid in the rendering of RawData objects.
void HandleMouseWheel(Event_t *event)
static std::map< int, int > gsNFLSHit
int GetTrackID() const
Track ID.
TGCheckButton * fShowPositive
static bool CompVtxZ(const sim::Particle &a, const sim::Particle &b)
static const char * LatexName(int pdgcode)
Convert PDG code to a latex string (root-style)
TGCheckButton * fDrawCheck[kNPart]
static bool CompTrackId(const sim::Particle &a, const sim::Particle &b)
Render the objects from the Simulation package.
Aid in the rendering of RawData objects.
double Vz(const int i=0) const
const sim::Particle * fCheckMap[kNPart]
float GetEdep() const
Get total Energy deposited into the cell for the whole FLSHit.
static bool CompMother(const sim::Particle &a, const sim::Particle &b)
TGCheckButton * fShowNeutral