TrackCounter: added method OutputEventTracks() for storing scanning results.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Jan 2007 19:10:20 +0000 (19:10 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Jan 2007 19:10:20 +0000 (19:10 +0000)
EVE/Reve/Track.cxx
EVE/Reve/Track.h

index 04612d8..36b6ee0 100644 (file)
@@ -574,7 +574,7 @@ void TrackCounter::DoTrackAction(Track* track)
 {
   // !!!! No check done if ok.
   // !!!! Should also override RemoveElementLocal
-  // !!!! But then ... should also sore local information if track is ok.
+  // !!!! But then ... should also sotre local information if track is ok.
 
   switch (fClickAction)
   {
@@ -612,3 +612,36 @@ void TrackCounter::DoTrackAction(Track* track)
 
   } // end switch fClickAction
 }
+
+/**************************************************************************/
+
+void TrackCounter::OutputEventTracks(FILE* out)
+{
+  if (out == 0)
+  {
+    out = stdout;
+    fprintf(out, "TrackCounter::FinalizeEvent()\n");
+  }
+
+  fprintf(out, "Event = %d  Ntracks = %d\n", fEventId, fGoodTracks);
+
+  TIter tlists(&fTrackLists);
+  TrackList* tlist;
+  Int_t cnt = 0;
+  while ((tlist = (TrackList*) tlists()) != 0)
+  {
+    List_i i = tlist->BeginChildren();
+    while (i != tlist->EndChildren())
+    {
+      Track* t = dynamic_cast<Track*>(*i);
+      if (t != 0 && t->GetLineStyle() == 1)
+      {
+       ++cnt;
+       fprintf(out, " %2d: chg=%+2d  pt=%8.5f  eta=%+8.5f\n",
+              cnt, t->fCharge, t->fP.Perp(), t->fP.Eta());
+      }
+      ++i;
+    }
+
+  }
+}
index 0692b55..ef42ee4 100644 (file)
@@ -216,6 +216,8 @@ protected:
   Int_t fBadLineStyle;
   Int_t fClickAction;
 
+  Int_t fEventId;
+
   Int_t fAllTracks;
   Int_t fGoodTracks;
 
@@ -225,6 +227,9 @@ public:
   TrackCounter(const Text_t* name="TrackCounter", const Text_t* title="");
   virtual ~TrackCounter();
 
+  Int_t GetEventId() const { return fEventId; }
+  void  SetEventId(Int_t id) { fEventId = id; }
+
   void Reset();
 
   void RegisterTracks(TrackList* tlist, Bool_t goodTracks);
@@ -234,6 +239,8 @@ public:
   Int_t GetClickAction() const  { return fClickAction; }
   void  SetClickAction(Int_t a) { fClickAction = a; }
 
+  void OutputEventTracks(FILE* out=0);
+
   static TrackCounter* fgInstance;
 
   ClassDef(TrackCounter, 1);