Gene,
I was writing the following reply when I received Tony's response to
your query. His solution of using a predicate is elegant. However, it
won't work for you if you've added the TrackReco processes to the
driver's list. Please also look over the approach that I've outlined
below.
I use a Reconstruction class to select how many (or which) events I
analyze. I've modified it to also allow selecting events. I've attached
the modified version which includes the following elements and methods:
static int FirstEvent=1;
static int LastEvent=1000000;
static boolean GoodEvent = true;
public static int getFirstEvent() { return FirstEvent; }
public static int getLastEvent() { return LastEvent; }
public static void setFirstEvent(int first) { FirstEvent = first; }
public static void setLastEvent(int last) { LastEvent = last; }
public static boolean isGoodEvent() { return GoodEvent; }
public static void setGoodEvent(boolean good) { GoodEvent = good; }
I use it in each process with a line like
if
(nEvt<Reconstruction.getFirstEvent()||nEvt>Reconstruction.getLastEvent())
return;
However, this version with GoodEvent is not know by the server, and it's
not easy to fool the server unless you're willing to rebuild its code. I
would suggest the following.
In your main process, TrackJetAna, execute TrackReco's processes. That
is, take out the
add(new TrackReco());
line in your driver JetFinderTestV5, and in TrackJetAna's constructor
and processor methods add
public TrackJetAna()
{
// Finds tracks in main tracker.
tracker = new hep.lcd.recon.tracking.tpc.TPCReco();
// Add reconstructed tracks to event
addReconTrks = new AddReconTrks(tracker);
// Turn off track fitting
addReconTrks.setNoFitting();
...
}
public void process(LCDEvent event)
{
...
if (!Reconstruction.isGoodEvent()) return;
tracker.process(event);
addReconTrks.process(event);
...
}
hep.lcd.recon.tracking.Tracker tracker;
hep.lcd.recon.tracking.AddReconTrks addReconTrks;
It would be more direct to modifiy the base Driver class to check flags
or whatever, but we'll need to review the design after Sitges.
Mike
/* Reconstruction.java */
public class Reconstruction
{
static int FirstEvent=1;
static int LastEvent=1000000;
static boolean GoodEvent = true;
public static boolean Hist = true;
public static boolean MCHist = true;
public static boolean TrkHist = true;
public static boolean CalHist = true;
public static boolean PIDHist = true;
public static boolean EvtHist = true;
public static boolean AnlHist = true;
public static int getFirstEvent() { return FirstEvent; }
public static int getLastEvent() { return LastEvent; }
public static void setFirstEvent(int first) { FirstEvent = first; }
public static void setLastEvent(int last) { LastEvent = last; }
public static boolean isGoodEvent() { return GoodEvent; }
public static void setGoodEvent(boolean good) { GoodEvent = good; }
}
|