HepevtModule Class Reference

#include <HepevtModule.h>

Inheritance diagram for HepevtModule:

JobCModule List of all members.

Public Member Functions

 HepevtModule ()
 ~HepevtModule ()
JobCResult Get (MomNavigator *mom)
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void BeginJob ()
void EndJob ()

Static Public Member Functions

static void SetDefaultDetector (Detector::Detector_t det)
static void SetDefaultStartVldTimeStamp (const VldTimeStamp &vts)
static void SetDefaultSpillTimeInterval (Double_t dt)
static VldTimeStamp GetDefaultStartVldTimeStamp ()
static Double_t GetDefaultStartVldTimeInterval ()

Private Member Functions

SimSnarlRecordFindOrCreateSimSnarlRecord (MomNavigator *mom)
 Find a record we can modify.
int CountNeededBogusNeuKin (TClonesArray *stdhep, std::vector< int > &splitIndices)
 Add bogus REROOT_NeuKin entries to make PTSim happy.
void AddBogusNeuKinEntries (SimSnarlRecord *record, int nneukin, TClonesArray *stdhep, std::vector< int > &splitIndices)
void FillNeuKinStructFromStdHepRange (NEUKIN_DEF *neukin, TClonesArray *stdhep, int ibeg, int iend)
void ModifyStdHep (TClonesArray *stdhep)
 adjust status codes, squeeze out unwanted lines

Private Attributes

Detector::Detector_t fDetector
VldTimeStamp fTimeStampStart
Double_t fDtSpill
Int_t fRun
Int_t fSubRun
Int_t fSnarl
size_t fNSnarlsCreated
TLorentzVector fVtxOffset
std::string fStdHepInputFileName
std::ifstream fStdHepInputFile
Int_t fInputBinaryFD
Bool_t fGetApplyRollback
Bool_t fAnaPrintStdHep
Int_t fIonScheme
Bool_t fFixCharmDKStatus
Bool_t fDropGeantEntries
Bool_t fDropTauDecayProducts
Bool_t fDropCharmDecayProducts
Bool_t fDropStatus999
std::string fStdHepEditString
Bool_t fForceNevHEPSnarl
Int_t fMakeBogusNeuKinEntries
Int_t fAddedLists
Int_t fAddedEntries
UtilHepevt::cunits_t fVtxConvert
UtilHepevt::cunits_t fTConvert
UtilHepevt::cunits_t fEConvert

Static Private Attributes

static Detector::Detector_t fgDefaultDetector = Detector::kUnknown
static VldTimeStamp fgDefaultStartTime = VldTimeStamp()
static Double_t fgDefaultDtSpill = 1.9

Detailed Description

Definition at line 33 of file HepevtModule.h.


Constructor & Destructor Documentation

HepevtModule::HepevtModule (  ) 

Definition at line 90 of file HepevtModule.cxx.

References LoadMinosPDG().

00091     : fDetector(fgDefaultDetector)
00092     , fTimeStampStart(fgDefaultStartTime)
00093     , fDtSpill(fgDefaultDtSpill)
00094     , fRun(1)
00095     , fSubRun(0)
00096     , fSnarl(-1)
00097     , fNSnarlsCreated(0)
00098     , fInputBinaryFD(-1)
00099     , fGetApplyRollback(true)
00100     , fAnaPrintStdHep(true)
00101     , fIonScheme(UtilPDG::kIonUnchanged)
00102     , fFixCharmDKStatus(true)
00103     , fDropGeantEntries(false)
00104     , fDropTauDecayProducts(false)
00105     , fDropCharmDecayProducts(false)
00106     , fDropStatus999(false)
00107     , fStdHepEditString("")
00108     , fForceNevHEPSnarl(false)
00109     , fMakeBogusNeuKinEntries(3)
00110     , fAddedLists(0)
00111     , fAddedEntries(0)
00112     , fVtxConvert(UtilHepevt::k_none)
00113     , fTConvert(UtilHepevt::k_none)
00114     , fEConvert(UtilHepevt::k_none)
00115 {
00116    // construct a new "HepevtModule" JobControl module
00117 
00118    // initialize detector to non-legal value
00119 
00120    LoadMinosPDG();
00121 
00122 }

HepevtModule::~HepevtModule (  ) 

Definition at line 126 of file HepevtModule.cxx.

References Msg::kVerbose, and MSG.

00127 {
00128   MSG("Hepevt", Msg::kVerbose) << "HepevtModule::Destructor\n";
00129 
00130 }


Member Function Documentation

void HepevtModule::AddBogusNeuKinEntries ( SimSnarlRecord record,
int  nneukin,
TClonesArray *  stdhep,
std::vector< int > &  splitIndices 
) [private]

Definition at line 536 of file HepevtModule.cxx.

References RecDataRecord< T >::AdoptComponent(), FillNeuKinStructFromStdHepRange(), RecDataRecord< T >::FindComponent(), and fMakeBogusNeuKinEntries.

Referenced by Get().

00539 {
00540   // Add REROOT_NeuKin entries to the "NeuKinList" in the SimSnarlRecord 
00541   // (create list if necessary).  Do this to keep PTSim happy...
00542 
00543   // if fMakeBogusNeuKinEntries is negative try to fill them in a meaningful way
00544 
00545   const TObject* const_obj = record->FindComponent("TClonesArray","NeuKinList");
00546   // cast away constness!!! so we can modify it ... bad, bad us!
00547   TObject* obj = const_cast<TObject*>(const_obj);
00548   if ( ! obj ) {
00549     // record didn't have a list ... make one
00550     TClonesArray* newarray = new TClonesArray("REROOT_NeuKin",0);
00551     newarray->SetName("NeuKinList");
00552     record->AdoptComponent(newarray); // add to the record
00553     obj = newarray;
00554   }
00555   // Now to the right type
00556   TClonesArray* neukinlist = dynamic_cast<TClonesArray*>(obj);  // this is already owned
00557   // Add entries
00558   int ientry = neukinlist->GetLast() + 1;
00559   for (int ikin = 0; ikin < nneukin; ++ikin) {
00560     if ( fMakeBogusNeuKinEntries < 0 ) {
00561       new((*neukinlist)[ientry++])REROOT_NeuKin();  // make bogus entries
00562     } else {
00563       // make bogus entries, but try to fill them in a meaningful way
00564       NEUKIN_DEF neukin;
00565       FillNeuKinStructFromStdHepRange(&neukin,stdhep,
00566                                       splitIndices[ikin],splitIndices[ikin+1]);
00567       new((*neukinlist)[ientry++])REROOT_NeuKin(&neukin);  
00568     }
00569   }
00570 }

JobCResult HepevtModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 788 of file HepevtModule.cxx.

References UtilHepevt::dump(), fAnaPrintStdHep, RecDataRecord< T >::FindComponent(), MomNavigator::GetFragment(), SimSnarlRecord::GetSimSnarlHeader(), JobCResult::kPassed, JobCResult::kWarning, Msg::kWarning, MSG, SimSnarlRecord::Print(), and SimSnarlHeader::Print().

00789 {
00790    // Check out current RecSimSnarl Record from the current REROOT event
00791 
00792    const TObject* obj = 0;
00793 
00794    SimSnarlRecord* simrec = 
00795       dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00796    if (!simrec) {
00797       MSG("Hepevt", Msg::kWarning) << 
00798         "HepevtModule::Ana no SimSnarlRecord" << endl;
00799       return JobCResult::kWarning;
00800    }
00801 
00802    // leading space
00803    cout << endl;
00804    cout << "HepevtModule::Ana() begin ================================================= " << endl;
00805    // print the header
00806    simrec->GetSimSnarlHeader()->Print();
00807    cout << endl; // finish off header
00808 
00809    if (fAnaPrintStdHep) {
00810        obj = simrec->FindComponent("TClonesArray","StdHep");
00811        const TClonesArray* newstdhep = dynamic_cast<const TClonesArray*>(obj);
00812        if (!newstdhep) {
00813            MSG("Hepevt", Msg::kWarning) << 
00814                "HepevtModule::Ana no StdHep " << obj << endl;
00815            simrec->Print();
00816            return JobCResult::kWarning;
00817        }
00818        else UtilHepevt::dump(newstdhep,1);  //alt_print_tclones_stdhep(newstdhep);
00819    }
00820    cout << "HepevtModule::Ana() done ================================================== " << endl;
00821 
00822    return JobCResult::kPassed; // All Ok
00823 }

void HepevtModule::BeginJob (  )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 1067 of file HepevtModule.cxx.

01068 {
01069 
01070 }

void HepevtModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 889 of file HepevtModule.cxx.

References UtilHepevt::asString(), UtilHepevt::closeBinary(), fAnaPrintStdHep, fDetector, fDropCharmDecayProducts, fDropGeantEntries, fDropStatus999, fDropTauDecayProducts, fDtSpill, fEConvert, fFixCharmDKStatus, fForceNevHEPSnarl, fGetApplyRollback, fInputBinaryFD, fIonScheme, fMakeBogusNeuKinEntries, fRun, fSnarl, fStdHepEditString, fStdHepInputFile, fStdHepInputFileName, fSubRun, fTConvert, fVtxConvert, fVtxOffset, Registry::Get(), Registry::GetCharString(), JobCModule::GetName(), UtilPDG::ionSchemeName(), Msg::kInfo, MSG, UtilHepevt::openBinary(), minos::PostOnWhiteBoard(), and UtilHepevt::string2cunits().

00890 {
00891 //======================================================================
00892 // Configure the module given the registry r
00893 //======================================================================
00894   const char*  tmps;
00895   double tmpd;
00896   int    tmpi;
00897 
00898   if (r.Get("Detector",   tmpi)) { fDetector = (Detector::Detector_t)tmpi; }
00899   if (r.Get("DtSpill",    tmpd)) { fDtSpill  = tmpd; }
00900   if (r.Get("Run",        tmpi)) { fRun      = tmpi; }
00901   if (r.Get("SubRun",     tmpi)) { fSubRun   = tmpi; }
00902   if (r.Get("FirstSnarl", tmpi)) { fSnarl    = tmpi-1; } // start -1 so ++ works
00903 
00904   // changing file or input binary mode triggers close/re-open
00905   bool new_file = false;
00906   if (r.Get("StdHepInputFile", tmps)) { 
00907     std::string fname = tmps;
00908     if ( fname != "" ) {
00909       if ( fname != fStdHepInputFileName ) new_file = true;
00910       fStdHepInputFileName = fname;
00911     }
00912   }
00913   int isbinary = 0;
00914   if (r.Get("InputBinary", tmpi)) { isbinary = tmpi; }
00915   int current_binary = ( fInputBinaryFD != -1 ) ? 1 : 0;
00916   bool switch_mode = ( current_binary != isbinary );
00917 
00918   if ( new_file || switch_mode ) {
00919     // close any binary file
00920     UtilHepevt::closeBinary(fInputBinaryFD);
00921     // close any open ascii file
00922     if ( fStdHepInputFile.is_open() ) fStdHepInputFile.close();
00923 
00924     if ( fStdHepInputFileName != "" ) {
00925       if ( isbinary ) {
00926         fInputBinaryFD = UtilHepevt::openBinary(fStdHepInputFileName.c_str(),false);
00927         if ( fInputBinaryFD != -1 ) {
00928           MSG("Hepevt",Msg::kInfo) 
00929             << "Successfully opened binary file " << fStdHepInputFileName
00930             << " for StdHep events to append to SimSnarl" << endl;
00931         }
00932       } else {
00933         fStdHepInputFile.open(fStdHepInputFileName.c_str(),ifstream::in);
00934         if ( fStdHepInputFile.is_open() ) {
00935           MSG("Hepevt",Msg::kInfo) 
00936             << "Successfully opened ascii file " << fStdHepInputFileName
00937             << " for StdHep events to append to SimSnarl" << endl;
00938         }
00939       }
00940     }
00941   }
00942 
00943   TLorentzVector voffset(fVtxOffset);
00944   if (r.Get("VtxOffsetX", tmpd)) { voffset.SetX(tmpd); }
00945   if (r.Get("VtxOffsetY", tmpd)) { voffset.SetY(tmpd); }
00946   if (r.Get("VtxOffsetZ", tmpd)) { voffset.SetZ(tmpd); }
00947   if (r.Get("VtxOffsetT", tmpd)) { voffset.SetT(tmpd); }
00948   if ( voffset != fVtxOffset ) {
00949     fVtxOffset = voffset;
00950     MSG("Hepevt",Msg::kInfo) 
00951       << "Using vtx offset of { " 
00952       << fVtxOffset.X() << ", "
00953       << fVtxOffset.Y() << ", "
00954       << fVtxOffset.Z() << ", "
00955       << fVtxOffset.T() << " }" << endl;
00956     // publish these on the whiteboard
00957     minos::PostOnWhiteBoard("EvtInfo","VtxOffsetX",fVtxOffset.X());
00958     minos::PostOnWhiteBoard("EvtInfo","VtxOffsetY",fVtxOffset.Y());
00959     minos::PostOnWhiteBoard("EvtInfo","VtxOffsetZ",fVtxOffset.Z());
00960     minos::PostOnWhiteBoard("EvtInfo","VtxOffsetT",fVtxOffset.T());
00961   }
00962 
00963   bool changeUnits = false;
00964   if ( r.Get("vtxConvert",tmps) ) {
00965     UtilHepevt::cunits_t vtxConvert = UtilHepevt::string2cunits(tmps);
00966     //MSG("Hepevt",Msg::kInfo) << " vtxC " << tmps << " " << vtxConvert << " " << fVtxConvert << endl;
00967     if ( fVtxConvert != vtxConvert ) {
00968       fVtxConvert = vtxConvert;
00969       changeUnits = true;
00970     }
00971   }
00972   if ( r.Get("tConvert",tmps) ) {
00973     UtilHepevt::cunits_t tConvert = UtilHepevt::string2cunits(tmps);
00974     //MSG("Hepevt",Msg::kInfo) << " vtxC " << tmps << " " << tConvert << " " << fTConvert << endl;
00975     if ( fTConvert != tConvert ) {
00976       fTConvert = tConvert;
00977       changeUnits = true;
00978     }
00979   }
00980   if ( r.Get("eConvert",tmps) ) {
00981     UtilHepevt::cunits_t eConvert = UtilHepevt::string2cunits(tmps);
00982     //MSG("Hepevt",Msg::kInfo) << " vtxC " << tmps << " " << eConvert << " " << fEConvert << endl;
00983     if ( fEConvert != eConvert ) {
00984       fEConvert = eConvert;
00985       changeUnits = true;
00986     }
00987   }
00988   if ( changeUnits ) {
00989     MSG("Hepevt",Msg::kInfo) 
00990       << "Setting unit conversion "
00991       << "vtx = " << UtilHepevt::asString(fVtxConvert)
00992       << ", t = " << UtilHepevt::asString(fTConvert)
00993       << ", e = " << UtilHepevt::asString(fEConvert)
00994       << endl;
00995   }
00996 
00997   if (r.Get("GetApplyRollback",    tmpi)) { fGetApplyRollback   = tmpi; }
00998   if (r.Get("AnaPrintStdHep",      tmpi)) { fAnaPrintStdHep     = tmpi; }
00999 
01000   if (r.Get("ConvertIonPDG",tmpi)) {
01001     if (fIonScheme != tmpi) {
01002       MSG("Hepevt",Msg::kInfo) 
01003         << GetName() << " will convert ions using the "
01004         << UtilPDG::ionSchemeName((UtilPDG::ionscheme_t)tmpi)
01005         << " scheme." << endl;
01006     }
01007     fIonScheme = tmpi;
01008   }
01009   
01010   bool changeEdit = false;
01011   if (r.Get("FixCharmDKStatus",      tmpi)) 
01012     { if ( fFixCharmDKStatus != tmpi ) 
01013       { fFixCharmDKStatus = tmpi; changeEdit=true; } }
01014   if (r.Get("DropGeantEntries",      tmpi)) 
01015     { if ( fDropGeantEntries != tmpi )
01016       { fDropGeantEntries = tmpi; changeEdit=true; } }
01017   if (r.Get("DropTauDecayProducts",  tmpi)) 
01018     { if ( fDropTauDecayProducts != tmpi ) 
01019       { fDropTauDecayProducts = tmpi; changeEdit=true; } }
01020   if (r.Get("DropCharmDecayProducts",tmpi)) 
01021     { if ( fDropCharmDecayProducts != tmpi )
01022       { fDropCharmDecayProducts = tmpi; changeEdit=true; } }
01023   if (r.Get("DropStatus999",         tmpi)) 
01024     { if ( fDropStatus999 != tmpi )
01025       { fDropStatus999 = tmpi; changeEdit=true; } }
01026 
01027   std::string tmpstr = r.GetCharString("StdHepEditString");
01028   if ( tmpstr != fStdHepEditString )
01029     { fStdHepEditString = tmpstr; changeEdit=true; }
01030 
01031   if ( changeEdit ) {
01032     MSG("Hepevt",Msg::kInfo)
01033       << GetName() << " StdHep list editing,"
01034       << " FixCharmDKStatus " << (fFixCharmDKStatus?"yes":"no")
01035       << endl <<  "    Drop:  "
01036       << " GeantEntries="       << (fDropGeantEntries?"yes":"no")
01037       << " TauDecayProducts="   << (fDropTauDecayProducts?"yes":"no")
01038       << " CharmDecayProducts=" << (fDropCharmDecayProducts?"yes":"no")
01039       << " Status999="          << (fDropStatus999?"yes":"no")
01040       << endl;
01041     if (fStdHepEditString != "") {
01042       MSG("Hepevt",Msg::kInfo)
01043         << " StdHepEditString: \"" << fStdHepEditString << "\""
01044         << endl;
01045     }
01046   }
01047 
01048   bool change2 = false;
01049   if (r.Get("ForceNevHEPSnarl",      tmpi)) 
01050     { if ( fForceNevHEPSnarl != tmpi ) 
01051       { fForceNevHEPSnarl = tmpi; change2=true; } }
01052   if (r.Get("BogusNeuKin",     tmpi)) 
01053     { if ( fMakeBogusNeuKinEntries != tmpi )
01054       { fMakeBogusNeuKinEntries = tmpi; change2=true; } }
01055   if ( change2 ) {
01056     MSG("Hepevt",Msg::kInfo)
01057       << GetName() << " ForceNevHEPSnarl = "
01058       << (fForceNevHEPSnarl?"true":"false")
01059       << ", MakeBogusNeuKinEntries = " << fMakeBogusNeuKinEntries
01060       << endl;
01061   }
01062 
01063 }

int HepevtModule::CountNeededBogusNeuKin ( TClonesArray *  stdhep,
std::vector< int > &  splitIndices 
) [private]

Add bogus REROOT_NeuKin entries to make PTSim happy.

Definition at line 432 of file HepevtModule.cxx.

References fMakeBogusNeuKinEntries, hepevtmdlns::isInitialState(), Msg::kDebug, Msg::kWarning, MAXMSG, and MSG.

Referenced by Get().

00434 {
00435   // Determing # of "events" PTSim is going to consider this stdhep
00436   // as having based on an imitation of its algorithm for splitting.
00437 
00438 
00439   Int_t nstdhep = stdhep->GetEntriesFast();
00440 
00441   Int_t nevents = 0;
00442   splitIndices.clear();
00443 
00444   // how to count
00445   switch ( abs(fMakeBogusNeuKinEntries) ) {
00446   case  1:
00447     {
00448       // no splitting, always assume 1 
00449       nevents = 1;
00450       splitIndices.push_back(0);
00451       break; 
00452     }
00453   case  2: 
00454     {
00455       // try to approximate "simple" splitting scheme in PTSim 
00456       // each "event" is a unspecified series of status 0 
00457       // (or 1001, 2001 for Minerva)  entries followed by some w/ 
00458       // other status values.  Seeing status 0 again triggers new event.
00459       int mcindex = -1;
00460       bool ready_for_trigger = true;
00461       for ( Int_t istd = 0; istd < nstdhep; istd++ ) {
00462         TParticle* simstdhep = dynamic_cast<TParticle*>(stdhep->At(istd));
00463         Int_t status = simstdhep->GetStatusCode();
00464         // 0=neugen/genie initial state
00465         // 3=nuance initial state
00466         // 1001/2001 minerva/argoneut initial state 
00467         //   (after propagation through those detectors)
00468         if ( hepevtmdlns::isInitialState(status) ) {
00469           if ( ready_for_trigger ) {
00470             // start new event
00471             ++mcindex;
00472             splitIndices.push_back(istd);
00473             ready_for_trigger = false;
00474             MSG("Hepevt",Msg::kDebug) 
00475               << "CountNeededBogusNeuKin-2 add indx at " << istd << std::endl;
00476           }
00477         } else {
00478           ready_for_trigger = true;
00479         }
00480       }
00481       nevents = mcindex+1;
00482       MSG("Hepevt",Msg::kDebug) 
00483         << "CountNeededBogusNeuKin-2 nevents " << nevents << std::endl;
00484 
00485       break;
00486     }
00487   case  3: 
00488     {
00489       // try to approximate splitting scheme in PTSim
00490       int mcindex = -1;
00491       int nprim = 0;
00492       bool prevchild = true;
00493       
00494       for ( Int_t istd = 0; istd < nstdhep; istd++ ) {
00495         TParticle* simstdhep = dynamic_cast<TParticle*>(stdhep->At(istd));
00496         
00497         if ( simstdhep->GetMother(0) == -1 && simstdhep->GetMother(1) == -1 ) {
00498           // primary, check to make sure its new event
00499           nprim++;
00500           if ( nprim > 2 || prevchild ) {
00501             mcindex++;
00502             splitIndices.push_back(istd);
00503             nprim = 1;
00504             MSG("Hepevt",Msg::kDebug) 
00505               << "CountNeededBogusNeuKin-3 add indx at " << istd << std::endl;
00506           }
00507           prevchild = false;
00508         } else {
00509           prevchild = true;
00510           nprim = 0;
00511         }
00512       }
00513       nevents = mcindex+1;
00514       MSG("Hepevt",Msg::kDebug) 
00515         << "CountNeededBogusNeuKin-3 nevents " << nevents << std::endl;
00516 
00517       break;
00518     }
00519   default:
00520     {
00521       MAXMSG("Hepevt",Msg::kWarning,5)
00522         << "CountNeededBogusNeuKin switch=" << fMakeBogusNeuKinEntries
00523         << " not a recognized setting" << endl;
00524       nevents = 1;
00525       splitIndices.push_back(0);
00526     }
00527 
00528   }
00529   splitIndices.push_back(nstdhep);
00530 
00531   return nevents;
00532 }

const Registry & HepevtModule::DefaultConfig (  )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 826 of file HepevtModule.cxx.

References fDtSpill, fRun, fSubRun, JobCModule::GetName(), UtilPDG::kIonUnchanged, Detector::kUnknown, Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00827 {
00828 //======================================================================
00829 // Create a registry which holds the default configuration and return it
00830 //======================================================================
00831   static Registry r;
00832  
00833   // Set name of config
00834   std::string name = this->GetName();
00835   name += ".config.default";
00836   r.SetName(name.c_str());
00837 
00838   // Set values of config
00839   r.UnLockValues();
00840 
00841   // if creating records out of whole cloth here's a starting point
00842   r.Set("Detector",   Detector::kUnknown); // user must set!
00843   r.Set("DtSpill",    fDtSpill);  // time between spills
00844   r.Set("Run",        fRun);  //
00845   r.Set("SubRun",     fSubRun);
00846   r.Set("FirstSnarl", 0);  // starting snarl #
00847 
00848   // This module assumes that the input file is in the minossoft
00849   // offline coordinate system (though stored internally the the StdHep
00850   // units of millimeters).  If the input file is from GMINOS (i.e. z=0
00851   // is the front of the hall rather than 2mm upstream of the front
00852   // of the plane 0 steel) then you must add the appropriate offset:
00853   //     NearDet:    VtxOffsetZ = -49.07 
00854   //     FarDet:     VtxOffsetZ = -14.02
00855   r.Set("VtxOffsetX", 0.0);
00856   r.Set("VtxOffsetY", 0.0);
00857   r.Set("VtxOffsetZ", 0.0);
00858   r.Set("VtxOffsetT", 0.0);
00859 
00860   r.Set("vtxConvert", "none");
00861   r.Set("tConvert",   "none");
00862   r.Set("eConvert",   "none");
00863 
00864   r.Set("StdHepInputFile",    "");
00865   r.Set("InputBinary",         0);
00866 
00867   r.Set("GetApplyRollback",    1);
00868   r.Set("AnaPrintStdHep",      1);
00869 
00870   r.Set("ConvertIonPDG",(int)UtilPDG::kIonUnchanged);
00871   r.Set("FixCharmDKStatus",       1);  // do *this* by default
00872   r.Set("DropGeantEntries",       0);
00873   r.Set("DropTauDecayProducts",   0);
00874   r.Set("DropCharmDecayProducts", 0);
00875   r.Set("DropStatus999",          0);
00876   r.Set("StdHepEditString",      "");
00877 
00878   r.Set("ForceNevHEPSnarl",       0);
00879 
00880   r.Set("BogusNeuKin",            3); // make bogus REROOT_NeuKin entries (PTSim default algorithm for splitting)
00881 
00882   r.LockValues();
00883 
00884   return r;
00885 }

void HepevtModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 1074 of file HepevtModule.cxx.

References fAddedEntries, fAddedLists, Msg::kInfo, and MSG.

01075 {
01076 
01077   MSG("Hepevt",Msg::kInfo)
01078     << "HepevtModule Added " << fAddedEntries << " entries to " 
01079     << fAddedLists << " lists" << endl;
01080 
01081 }

void HepevtModule::FillNeuKinStructFromStdHepRange ( NEUKIN_DEF neukin,
TClonesArray *  stdhep,
int  ibeg,
int  iend 
) [private]

Definition at line 573 of file HepevtModule.cxx.

References NEUKIN_DEF::A, NEUKIN_DEF::EMFrac, UtilPDG::getIonAZJ(), NEUKIN_DEF::IAction, NEUKIN_DEF::IBoson, NEUKIN_DEF::ID, NEUKIN_DEF::IFlags, NEUKIN_DEF::INu, INULL, NEUKIN_DEF::INuNoOsc, NEUKIN_DEF::IResonance, UtilPDG::isElectron(), hepevtmdlns::isInitialState(), UtilPDG::isMuon(), UtilPDG::isNeutrino(), UtilPDG::isNeutron(), UtilPDG::isProton(), UtilPDG::isTau(), NEUKIN_DEF::IStruckQ, NEUKIN_DEF::ITg, NEUKIN_DEF::P4El1, NEUKIN_DEF::P4El2, NEUKIN_DEF::P4Mu1, NEUKIN_DEF::P4Mu2, NEUKIN_DEF::P4Neu, NEUKIN_DEF::P4NeuNoOsc, NEUKIN_DEF::P4Shw, NEUKIN_DEF::P4Tau, NEUKIN_DEF::P4Tgt, NEUKIN_DEF::Q2, RNULL, NEUKIN_DEF::Sigma, NEUKIN_DEF::SigmaDiff, NEUKIN_DEF::W2, NEUKIN_DEF::X, NEUKIN_DEF::Y, and NEUKIN_DEF::Z.

Referenced by AddBogusNeuKinEntries().

00576 {
00577 
00578   const int   INULL = 2147483647;  /* null values ala ADAMO */
00579   const float RNULL = 699050.*65536.*65536.*65536.*65536.*65536.*65536.*256.;
00580 
00581   // set default to what ADAMO nulwin would set the values to
00582   neukin->ID         = INULL;
00583   neukin->INu        = INULL;
00584   neukin->INuNoOsc   = INULL;
00585   neukin->ITg        = INULL;
00586   neukin->IBoson     = INULL;
00587   neukin->IResonance = INULL;
00588   neukin->IAction    = INULL;
00589   neukin->IStruckQ   = INULL;
00590   neukin->IFlags     = INULL;
00591   neukin->A          = RNULL;
00592   neukin->Z          = RNULL;
00593   neukin->Sigma      = RNULL;
00594   neukin->SigmaDiff  = RNULL;
00595   neukin->X          = RNULL;
00596   neukin->Y          = RNULL;
00597   neukin->Q2         = RNULL;
00598   neukin->W2         = RNULL;
00599   neukin->EMFrac     = RNULL;
00600 
00601 // Fill simple arrays from NeuKin struct.
00602   Int_t i;
00603   for (i=0; i<4; i++) {
00604         neukin->P4Neu[i]      = RNULL;
00605         neukin->P4NeuNoOsc[i] = RNULL;
00606         neukin->P4Tgt[i]      = RNULL;
00607         neukin->P4Shw[i]      = RNULL;
00608         neukin->P4Mu1[i]      = RNULL;
00609         neukin->P4Mu2[i]      = RNULL;
00610         neukin->P4El1[i]      = RNULL;
00611         neukin->P4El2[i]      = RNULL;
00612         neukin->P4Tau[i]      = RNULL;
00613   }
00614 
00615   neukin->IFlags       = INULL;
00616   neukin->IStruckQ     = INULL;
00617   neukin->SigmaDiff    = RNULL;
00618 
00619   int     tmp_nshw = 0;
00620   Float_t tmp_p4shw[4] = { 0, 0, 0, 0 };
00621 
00622   // work backward through the StdHep list
00623   for (int ihep=iend-1; ihep >= ibeg; --ihep) {
00624     const TParticle* apart = dynamic_cast<const TParticle*>(stdhep->At(ihep));
00625     if ( ! apart ) continue;
00626 
00627     int istatus = apart->GetStatusCode();
00628     int ipdg    = apart->GetPdgCode();
00629 
00630     bool isnu  = UtilPDG::isNeutrino(ipdg);
00631     bool isel  = UtilPDG::isElectron(ipdg);
00632     bool ismu  = UtilPDG::isMuon(ipdg);
00633     bool istau = UtilPDG::isTau(ipdg);
00634     
00635     if ( hepevtmdlns::isInitialState(istatus) ) {
00636       if ( isnu ) {
00637         // initial state neutrino
00638         if ( neukin->INu == INULL ) {
00639           neukin->INu = ipdg;
00640           neukin->P4Neu[0] = apart->Px();
00641           neukin->P4Neu[1] = apart->Py();
00642           neukin->P4Neu[2] = apart->Pz();
00643           neukin->P4Neu[3] = apart->Energy();
00644         }
00645         neukin->INuNoOsc = ipdg;
00646         neukin->P4NeuNoOsc[0] = apart->Px();
00647         neukin->P4NeuNoOsc[1] = apart->Py();
00648         neukin->P4NeuNoOsc[2] = apart->Pz();
00649         neukin->P4NeuNoOsc[3] = apart->Energy();
00650       } else {
00651         // initial state target
00652         neukin->ITg = ipdg;
00653         neukin->P4Tgt[0] = apart->Px();
00654         neukin->P4Tgt[1] = apart->Py();
00655         neukin->P4Tgt[2] = apart->Pz();
00656         neukin->P4Tgt[3] = apart->Energy();
00657         if ( ipdg >= 1000000000 && ipdg < 2000000000 ) {
00658           int ia, iz, ij;
00659           UtilPDG::getIonAZJ(ipdg,ia,iz,ij);
00660           neukin->A = ia;
00661           neukin->Z = iz;
00662         } else if ( UtilPDG::isProton(ipdg) ) {
00663           neukin->A = 1;
00664           neukin->Z = 1;
00665         } else if ( UtilPDG::isNeutron(ipdg) ) {
00666           neukin->A = 1;
00667           neukin->Z = 0;
00668         }
00669       }
00670     } // initial state
00671 
00672     if ( abs(ipdg) > 0 && abs(ipdg) < 9 ) neukin->IStruckQ = ipdg;
00673 
00674     if ( istatus == 1 ) {
00675       // final state particles
00676       // for now ASSUME no 2nd lepton
00677       if ( isel ) {
00678         neukin->P4El1[0] = apart->Px();
00679         neukin->P4El1[1] = apart->Py();
00680         neukin->P4El1[2] = apart->Pz();
00681         // sign of energy reflects sign of electron
00682         double esign = ( ipdg == 11 ) ? -1 : 1 ;
00683         neukin->P4El1[3] = apart->Energy() * esign;
00684       } else if ( ismu ) {
00685         neukin->P4Mu1[0] = apart->Px();
00686         neukin->P4Mu1[1] = apart->Py();
00687         neukin->P4Mu1[2] = apart->Pz();
00688         // sign of energy reflects sign of muon
00689         double esign = ( ipdg == 13 ) ? -1 : 1 ;
00690         neukin->P4Mu1[3] = apart->Energy() * esign;
00691       } else if ( istau ) {
00692         neukin->P4Tau[0] = apart->Px();
00693         neukin->P4Tau[1] = apart->Py();
00694         neukin->P4Tau[2] = apart->Pz();
00695         // sign of energy reflects sign of tau
00696         double esign = ( ipdg == 15 ) ? -1 : 1 ;
00697         neukin->P4Tau[3] = apart->Energy() * esign;
00698       } else if ( ! isnu ) {
00699         // everything else (that isn't a neutrino) is "shower"
00700         ++tmp_nshw;
00701         tmp_p4shw[0] += apart->Px();
00702         tmp_p4shw[1] += apart->Py();
00703         tmp_p4shw[2] += apart->Pz();
00704         tmp_p4shw[3] += apart->Energy();
00705       }
00706     }
00707 
00708   } // loop over particles
00709 
00710   if ( tmp_nshw > 0 ) {
00711     // saw something "shower-ish"
00712     for (int j=0; j<4; ++j ) neukin->P4Shw[j] = tmp_p4shw[j];
00713   }
00714 
00715 }

SimSnarlRecord * HepevtModule::FindOrCreateSimSnarlRecord ( MomNavigator mom  )  [private]

Find a record we can modify.

Definition at line 351 of file HepevtModule.cxx.

References VldTimeStamp::Add(), RecDataRecord< T >::AdoptComponent(), MomNavigator::AdoptFragment(), RecJobHistory::CreateJobRecord(), fDetector, fDtSpill, RecDataRecord< T >::FindComponent(), fNSnarlsCreated, MomNavigator::FragmentIter(), fRun, fSnarl, fSubRun, fTimeStampStart, UtilHepevt::getEmptyStdHep(), minos::GetFromWhiteBoard(), RecRecordImp< T >::GetJobHistory(), RecRecordImp< T >::GetTempTags(), gSystem(), Msg::kDebug, RecJobHistory::kGMinos, SimFlag::kMC, MSG, and Registry::Set().

Referenced by Get().

00352 {
00353    // Find SimSnarlRecord 
00354    // Ensure that it has a TClonesArray "StdHep" of TParticle objects
00355 
00356    SimSnarlRecord* record = 0;
00357 
00358    // See if a SimSnarlRecord already exists. 
00359    TObject* tobj;
00360    TIter    fragiter = mom->FragmentIter();
00361    while( ( tobj = fragiter.Next() ) ) {
00362      record = dynamic_cast<SimSnarlRecord*>(tobj);
00363      if (record) break;
00364    }
00365 
00366    // If not, make one.
00367    if ( record == 0 ) {
00368      ++fSnarl;
00369      ++fNSnarlsCreated;
00370 
00371      Short_t runtype = 0;
00372      UInt_t  trigsrc = 0;
00373      Int_t   timeframe = fSnarl; // ? what to choose
00374      Int_t   spilltype = -1;
00375 
00376      // a default method of choosing time stamps
00377      VldTimeStamp ts(fTimeStampStart);
00378      ts.Add(fDtSpill*fSnarl);
00379 
00380      // has someone dropped info onto the whiteboard for us to use?
00381      minos::GetFromWhiteBoard("EvtInfo","SnarlTimeStamp",ts);
00382      minos::GetFromWhiteBoard("EvtInfo","Snarl",fSnarl);
00383      minos::GetFromWhiteBoard("EvtInfo","RunType",runtype);
00384      minos::GetFromWhiteBoard("EvtInfo","TrigSrc",trigsrc);
00385          
00386      VldContext vldc(fDetector,SimFlag::kMC,ts);
00387 
00388      UInt_t  errcode = 0;
00389  
00390      VldTimeStamp mcGenTime;
00391      std::string  mcCodename("HepevtModule");
00392      std::string  mcHostname(gSystem->HostName());
00393      SimSnarlHeader simheader(vldc,fRun,fSubRun,runtype,errcode,
00394                               fSnarl,trigsrc,timeframe,spilltype,
00395                               mcGenTime,mcCodename,mcHostname);
00396      record = new SimSnarlRecord(simheader);
00397      // Add the history information to the record
00398      RecJobHistory& jobhist 
00399        = const_cast<RecJobHistory&>(record->GetJobHistory());
00400      jobhist.CreateJobRecord(RecJobHistory::kGMinos,mcCodename.c_str(),"",
00401                              mcHostname.c_str(),mcGenTime);
00402      
00403      MSG("Hepevt",Msg::kDebug)
00404        << "New SimSnarlRecord " << simheader << endl;
00405      
00406      // give the RecSimSnarl to MOM to hold as a "fragment"
00407      record->GetTempTags().Set("stream","SimSnarl");  
00408      record->GetTempTags().Set("tree","SimSnarl");  
00409      record->GetTempTags().Set("file","no-input-file");
00410      record->GetTempTags().Set("index",fSnarl);
00411      mom->AdoptFragment(record);
00412    }
00413    
00414    // Even if we didn't create the record make sure it has a StdHep list
00415    const TObject* const_obj = record->FindComponent("TClonesArray","StdHep");
00416    if ( ! const_obj ) {
00417      TClonesArray* stdhep = UtilHepevt::getEmptyStdHep();
00418      record->AdoptComponent(stdhep);
00419    }
00420 
00421    // Create a DigiRerootInfo to hold miscellaneous information about
00422    // the event generation.
00423    //DigiRerootInfo* drInfo = new DigiRerootInfo(fRun,fSnarl,fSnarl,vldc);
00424    //record->AdoptComponent(drInfo);
00425 
00426    return record;
00427 
00428 }

JobCResult HepevtModule::Get ( MomNavigator mom  )  [virtual]

Implement if your module needs to read data from some external source and fill mom

Reimplemented from JobCModule.

Definition at line 210 of file HepevtModule.cxx.

References AddBogusNeuKinEntries(), UtilHepevt::appendStdHep(), UtilHepevt::applyUnitConvert(), VldTimeStamp::AsString(), CountNeededBogusNeuKin(), UtilHepevt::dump(), fAddedEntries, fAddedLists, fEConvert, fForceNevHEPSnarl, fGetApplyRollback, RecDataRecord< T >::FindComponent(), FindOrCreateSimSnarlRecord(), fInputBinaryFD, fIonScheme, fMakeBogusNeuKinEntries, Form(), fRun, fSnarl, fStdHepInputFile, fStdHepInputFileName, fTConvert, fVtxConvert, fVtxOffset, CfgConfigurable::GetConfig(), UtilPDG::getDfltStdIonScheme(), UtilHepevt::getEmptyStdHep(), UtilHepevt::getNevHep(), MINFHeader::GetRun(), SimSnarlRecord::GetSimSnarlHeader(), gSystem(), header, DbiTableProxyRegistry::Instance(), MsgService::Instance(), MsgService::IsActive(), UtilHepevt::k_none, JobCResult::kAOK, Msg::kDebug, Msg::kError, JobCResult::kFailed, Msg::kInfo, Msg::kWarning, ModifyStdHep(), MSG, Registry::Print(), UtilHepevt::readAscii(), UtilHepevt::readBinary(), CfgConfigurable::Set(), MsgService::SetCurrentRunSnarl(), UtilPDG::setDfltStdIonScheme(), UtilHepevt::unpackCommon(), and CfgConfigurable::Update().

00211 {
00212   // Read input file for StdHep
00213   // Create SimSnarlRecord (if necessary)
00214   // Append StdHep
00215 
00216   MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() start" << endl;
00217 
00218    const int sigEndJob = SIGTERM; // what signal to raise on EOF (or no file)
00219 
00220    TClonesArray* addon = 0;
00221    if ( fStdHepInputFileName != "" ) {
00222      bool isFail = gSystem->AccessPathName(fStdHepInputFileName.c_str());
00223      if ( isFail ) {
00224        MSG("Hepevt",Msg::kError) << "No such StdHep file: "
00225                                  << fStdHepInputFileName << endl;
00226        raise(sigEndJob);
00227        return JobCResult::kFailed; // signal this record is junk as well
00228      }
00229      // reading from some input file ...
00230      if ( fStdHepInputFile.is_open() || fInputBinaryFD != -1 ) {
00231        if ( fInputBinaryFD != -1 ) {
00232          addon = UtilHepevt::getEmptyStdHep();
00233          addon->SetName("StdHep");
00234          UtilHepevt::readBinary(fInputBinaryFD);
00235          // readBinary will set filedescriptor < 0 if EOF and file got closed
00236          if ( fInputBinaryFD != -1 ) {
00237            UtilHepevt::unpackCommon(addon);
00238          } else {
00239            delete addon; addon = 0;  // signal EOF
00240          }
00241        } else {
00242          addon = UtilHepevt::readAscii(fStdHepInputFile);
00243        }
00244        // end-of-file signalled by no TClonesArray
00245        if ( ! addon ) {
00246          MSG("Hepevt",Msg::kWarning)
00247            << "No StdHep list read in from "
00248            << fStdHepInputFileName << " assume EOF {"
00249            << fStdHepInputFile.is_open() << " " << fInputBinaryFD << "}"
00250            << endl;
00251          // signal processing to end ... leaves useless last entry intact
00252          raise(sigEndJob);  // signal no more passes through jobc path
00253          return JobCResult::kFailed; // signal this record is junk as well
00254        }
00255      }
00256    }
00257 
00259    // Find or make the SimSnarl
00260 
00261    if ( fForceNevHEPSnarl ) {
00262      int nevhep = UtilHepevt::getNevHep();
00263      // use only if it looks like it is being set
00264      if ( nevhep > 0 ) fSnarl = nevhep-1; // will pre-increment if record is created
00265    }
00266   
00267    SimSnarlRecord* record = FindOrCreateSimSnarlRecord(mom);
00268    const SimSnarlHeader* header = record->GetSimSnarlHeader();
00269    fRun   = header->GetRun();
00270    fSnarl = header->GetSnarl();
00271    VldContext vldc = header->GetVldContext();
00272 
00273    // if we created this one then we'll be wanting to update this
00274    MsgService::Instance()->SetCurrentRunSnarl(fRun,fSnarl);
00275 
00276    MSG("Hepevt",Msg::kDebug)
00277      << endl
00278      << "#slew FindOrCreateSimSnarlRecord returned " << vldc << endl;
00279 
00280    static VldTimeStamp rollbackTS;
00281    VldTimeStamp mcGenTime = header->GetMcGenTime();
00282    if ( fGetApplyRollback && mcGenTime < rollbackTS ) {
00283      rollbackTS = mcGenTime;
00284      // rollback the database for Ugli* and Bfld*
00285      DbiTableProxyRegistry& dbiCfg = DbiTableProxyRegistry::Instance();
00286      // something like: 
00287      //   dbiCfg.Set("Rollback:Ugli*         =  '2002-08-01'");
00288      dbiCfg.Set(Form("Rollback:UGLIDBI* = '%s'",rollbackTS.AsString("sql")));
00289      dbiCfg.Set(Form("Rollback:BFLDDBIPLANEMAP* = '%s'",rollbackTS.AsString("sql")));
00290      dbiCfg.Set("RollbackType:UGLIDBI* = 'CREATIONDATE'");
00291      dbiCfg.Set("RollbackType:BFLDDBIPLANEMAP* = 'CREATIONDATE'");
00292      
00293      MSG("Hepevt",Msg::kInfo)
00294        << "HepevtModule is setting dbiCfg to: " << endl;
00295      MsgService* msgserv = MsgService::Instance();
00296      if (msgserv->IsActive("Hepevt",Msg::kInfo))
00297        dbiCfg.GetConfig().Print();
00298      
00299      dbiCfg.Update();
00300    }
00301 
00302    const TObject* const_obj = record->FindComponent("TClonesArray","StdHep");
00303    // cast away constness!!! so we can modify it ... bad, bad us!
00304    TObject* obj = const_cast<TObject*>(const_obj);
00305    // now to the right type
00306    TClonesArray* stdhep = dynamic_cast<TClonesArray*>(obj);  // this is already owned
00307    
00308    // adjust units for what we read in (if need be)
00309    if ( fVtxConvert != UtilHepevt::k_none ||
00310         fTConvert   != UtilHepevt::k_none ||
00311         fEConvert   != UtilHepevt::k_none    )
00312      UtilHepevt::applyUnitConvert(addon,fVtxConvert,fTConvert,fEConvert);
00313 
00314    if ( fMakeBogusNeuKinEntries != 0 ) {
00315      // [i]=start, [i+1]=end [start,end) for separate events
00316      std::vector<int> splitIndices;  
00317      int nneukin = CountNeededBogusNeuKin(addon,splitIndices);
00318      AddBogusNeuKinEntries(record,nneukin,addon,splitIndices);
00319    }
00320 
00321    fAddedLists++;
00322    fAddedEntries += addon->GetLast()+1;
00323    UtilHepevt::appendStdHep(stdhep,addon,fVtxOffset);
00324    delete addon;  // delete unowned array
00325 
00326    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() about to dump" << endl;
00327    // dump stuff at kDebug level
00328    if ( MsgService::Instance()->IsActive("Hepevt",Msg::kDebug) ) {
00329      MSG("Hepevt",Msg::kInfo)
00330        << " >>>>> Processing StdHep list:" << endl;
00331      UtilHepevt::dump(stdhep,1);
00332    }
00333 
00334    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() about reset ion scheme" << endl;
00335    // Set/Reset the PDG scheme used for ions before/after conversion.
00336    UtilPDG::ionscheme_t old_ionscheme = UtilPDG::getDfltStdIonScheme();
00337    UtilPDG::setDfltStdIonScheme((UtilPDG::ionscheme_t)fIonScheme);
00338 
00339    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() about ModifyStdHep" << endl;
00340    ModifyStdHep(stdhep);
00341 
00342    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() about restore ion scheme" << endl;
00343    UtilPDG::setDfltStdIonScheme(old_ionscheme);
00344 
00345    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::Get() about return AOK" << endl;
00346    return JobCResult::kAOK; // All Ok
00347 }

Double_t HepevtModule::GetDefaultStartVldTimeInterval (  )  [static]

Definition at line 73 of file HepevtModule.cxx.

References fgDefaultDtSpill.

00074 { return fgDefaultDtSpill; }

VldTimeStamp HepevtModule::GetDefaultStartVldTimeStamp (  )  [static]

Definition at line 71 of file HepevtModule.cxx.

References fgDefaultStartTime.

00072 { return fgDefaultStartTime; }

void HepevtModule::ModifyStdHep ( TClonesArray *  stdhep  )  [private]

adjust status codes, squeeze out unwanted lines

Definition at line 717 of file HepevtModule.cxx.

References fDropCharmDecayProducts, fDropGeantEntries, fDropStatus999, fDropTauDecayProducts, fFixCharmDKStatus, fStdHepEditString, Msg::kDebug, UtilHepevt::modStatusStdHep(), MSG, and UtilHepevt::squeezeStdHep().

Referenced by Get().

00718 {
00719   // Fix up decay chain of StdHep list 
00720   // Trim it appropriately
00721 
00722    MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep start" << endl;
00723   if (fFixCharmDKStatus) {
00724     // Fix cases where charm hadron generated particles (e.g. delta-rays)
00725     // before it decayed.  In this case the original was tagged ist=2,
00726     // the decay point was ist=1205 but the daughters had ist=205
00727     // rather than 1.  Be a bit careful in case we have charm->charm->stuff
00728     // (perhaps a D* -> D + gamma/pi0, but I haven't seen any of those
00729     // come out of NEUGEN in my study of a few files...)
00730 
00731     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep charmDKDaughters1" << endl;
00732     // decay products of charm that are ist=205 should be 1
00733     string charmDKDaughters1("fromcharm && ( ! ischarm ) && ist==205 ");
00734     UtilHepevt::modStatusStdHep(stdhep_list,charmDKDaughters1,1);
00735 
00736     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep charmDKDaughters2" << endl;
00737     // in case of charm(2)->charm(1205)->charm(205)->stuff, tag last charm 2
00738     string charmDKDaughters2("fromcharm && ischarm && ist==205 && da0 > -1  ");
00739     UtilHepevt::modStatusStdHep(stdhep_list,charmDKDaughters2,2);
00740   }
00741 
00742   if (fDropGeantEntries) {
00743     // drop entries added in GEANT propagation that aren't charm/tau related
00744     string dropGeant("(  (ist> 200 && ist< 231) || "
00745                      "   (ist> 300 && ist< 310) || "
00746                      "   (ist>1200 && ist<1231) || "
00747                      "   (ist>1300 && ist<1310) )  "
00748                      " && !ischarm && !istau ");
00749     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep dropGeant" << endl;
00750     UtilHepevt::modStatusStdHep(stdhep_list,dropGeant);
00751     UtilHepevt::squeezeStdHep(stdhep_list);
00752   }
00753   if (fDropTauDecayProducts) {
00754     // flag and remove tau decay point entry and decay daughters
00755     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep dropTauDK1" << endl;
00756     string dropTauDK("(istau && ist==1205) || (fromtau && ist==1)");
00757     UtilHepevt::modStatusStdHep(stdhep_list,dropTauDK);
00758     UtilHepevt::squeezeStdHep(stdhep_list);
00759     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep dropTauDK2" << endl;
00760     // reactivate tau as an active particle subject to decay IST=1
00761     UtilHepevt::modStatusStdHep(stdhep_list,"istau && ist==2 && da0==-1",1);
00762   }
00763   if (fDropCharmDecayProducts) {
00764     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep dropCharmDKProd1" << endl;
00765      // flag and remove charm decay point entry and decay daughters
00766     string dropCharmDK("(ischarm && ist==1205) || (fromcharm && ist==1)");
00767     UtilHepevt::modStatusStdHep(stdhep_list,dropCharmDK);
00768     UtilHepevt::squeezeStdHep(stdhep_list);
00769     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep reactiveateTau" << endl;
00770     // reactivate tau as an active particle subject to decay IST=1
00771     UtilHepevt::modStatusStdHep(stdhep_list,"ischarm && ist==2 && da0==-1",1);
00772   }
00773   if (fDropStatus999) {
00774     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep drop999" << endl;
00775     UtilHepevt::modStatusStdHep(stdhep_list,"ist==999");
00776     UtilHepevt::squeezeStdHep(stdhep_list);
00777   }
00778   if (fStdHepEditString != "") {
00779     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep user edit \"" << fStdHepEditString << "\"" << endl;
00780     UtilHepevt::modStatusStdHep(stdhep_list,fStdHepEditString);
00781     UtilHepevt::squeezeStdHep(stdhep_list);
00782   }
00783     MSG("Hepevt",Msg::kDebug) <<"HepevtModule::ModifyStdHep done" << endl;
00784 
00785 }

void HepevtModule::SetDefaultDetector ( Detector::Detector_t  det  )  [static]

Definition at line 64 of file HepevtModule.cxx.

00065 { fgDefaultDetector = det; }

void HepevtModule::SetDefaultSpillTimeInterval ( Double_t  dt  )  [static]

Definition at line 68 of file HepevtModule.cxx.

References fgDefaultDtSpill.

00069 { fgDefaultDtSpill = dt; }

void HepevtModule::SetDefaultStartVldTimeStamp ( const VldTimeStamp vts  )  [static]

Definition at line 66 of file HepevtModule.cxx.

References fgDefaultStartTime.

00067 { fgDefaultStartTime = vts; }


Member Data Documentation

Int_t HepevtModule::fAddedEntries [private]

Definition at line 115 of file HepevtModule.h.

Referenced by EndJob(), and Get().

Int_t HepevtModule::fAddedLists [private]

Definition at line 114 of file HepevtModule.h.

Referenced by EndJob(), and Get().

Bool_t HepevtModule::fAnaPrintStdHep [private]

Definition at line 101 of file HepevtModule.h.

Referenced by Ana(), and Config().

Detector::Detector_t HepevtModule::fDetector [private]

Definition at line 87 of file HepevtModule.h.

Referenced by Config(), and FindOrCreateSimSnarlRecord().

Bool_t HepevtModule::fDropCharmDecayProducts [private]

Definition at line 107 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

Bool_t HepevtModule::fDropGeantEntries [private]

Definition at line 105 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

Bool_t HepevtModule::fDropStatus999 [private]

Definition at line 108 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

Bool_t HepevtModule::fDropTauDecayProducts [private]

Definition at line 106 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

Double_t HepevtModule::fDtSpill [private]

Definition at line 89 of file HepevtModule.h.

Referenced by Config(), DefaultConfig(), and FindOrCreateSimSnarlRecord().

UtilHepevt::cunits_t HepevtModule::fEConvert [private]

Definition at line 119 of file HepevtModule.h.

Referenced by Config(), and Get().

Bool_t HepevtModule::fFixCharmDKStatus [private]

Definition at line 104 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

Bool_t HepevtModule::fForceNevHEPSnarl [private]

Definition at line 111 of file HepevtModule.h.

Referenced by Config(), and Get().

Detector::Detector_t HepevtModule::fgDefaultDetector = Detector::kUnknown [static, private]

Definition at line 123 of file HepevtModule.h.

Double_t HepevtModule::fgDefaultDtSpill = 1.9 [static, private]

Definition at line 125 of file HepevtModule.h.

Referenced by GetDefaultStartVldTimeInterval(), and SetDefaultSpillTimeInterval().

VldTimeStamp HepevtModule::fgDefaultStartTime = VldTimeStamp() [static, private]

Definition at line 124 of file HepevtModule.h.

Referenced by GetDefaultStartVldTimeStamp(), and SetDefaultStartVldTimeStamp().

Bool_t HepevtModule::fGetApplyRollback [private]

Definition at line 100 of file HepevtModule.h.

Referenced by Config(), and Get().

Int_t HepevtModule::fInputBinaryFD [private]

Definition at line 98 of file HepevtModule.h.

Referenced by Config(), and Get().

Int_t HepevtModule::fIonScheme [private]

Definition at line 103 of file HepevtModule.h.

Referenced by Config(), and Get().

Int_t HepevtModule::fMakeBogusNeuKinEntries [private]

Definition at line 112 of file HepevtModule.h.

Referenced by AddBogusNeuKinEntries(), Config(), CountNeededBogusNeuKin(), and Get().

size_t HepevtModule::fNSnarlsCreated [private]

Definition at line 93 of file HepevtModule.h.

Referenced by FindOrCreateSimSnarlRecord().

Int_t HepevtModule::fRun [private]

Definition at line 90 of file HepevtModule.h.

Referenced by Config(), DefaultConfig(), FindOrCreateSimSnarlRecord(), and Get().

Int_t HepevtModule::fSnarl [private]

Definition at line 92 of file HepevtModule.h.

Referenced by Config(), FindOrCreateSimSnarlRecord(), and Get().

std::string HepevtModule::fStdHepEditString [private]

Definition at line 109 of file HepevtModule.h.

Referenced by Config(), and ModifyStdHep().

std::ifstream HepevtModule::fStdHepInputFile [private]

Definition at line 97 of file HepevtModule.h.

Referenced by Config(), and Get().

std::string HepevtModule::fStdHepInputFileName [private]

Definition at line 96 of file HepevtModule.h.

Referenced by Config(), and Get().

Int_t HepevtModule::fSubRun [private]

Definition at line 91 of file HepevtModule.h.

Referenced by Config(), DefaultConfig(), and FindOrCreateSimSnarlRecord().

UtilHepevt::cunits_t HepevtModule::fTConvert [private]

Definition at line 118 of file HepevtModule.h.

Referenced by Config(), and Get().

VldTimeStamp HepevtModule::fTimeStampStart [private]

Definition at line 88 of file HepevtModule.h.

Referenced by FindOrCreateSimSnarlRecord().

UtilHepevt::cunits_t HepevtModule::fVtxConvert [private]

Definition at line 117 of file HepevtModule.h.

Referenced by Config(), and Get().

TLorentzVector HepevtModule::fVtxOffset [private]

Definition at line 95 of file HepevtModule.h.

Referenced by Config(), and Get().


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 00:32:53 2015 for loon by  doxygen 1.4.7