DetSim Class Reference

#include <DetSim.h>

Inheritance diagram for DetSim:
JobCModule DigiPEtoRawDigitModule

List of all members.

Public Member Functions

 DetSim ()
 ~DetSim ()
JobCResult Get (MomNavigator *mom)
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void Report ()

Private Member Functions

void InitWorkingArray (void)
void AddToCrate (VldContext &context, const RawChannelId &rcid, Int_t iadc, Int_t itdc, Bool_t error=false, Int_t truth_info=0)
void PackVaDigit (Int_t &cptr, TArrayI &wcrate, const RawChannelId &rcid, Int_t iadc, Int_t itdc, Bool_t error=false, Int_t truth_info=0)
void PackQieDigit (Int_t &cptr, TArrayI &wcrate, const RawChannelId &rcid, Int_t iadc, Int_t itdc, Bool_t error=false, Int_t truth_info=0)
RawDataBlockFinalizeWorkingArray (VldContext &context)
void CalculateAddTDC (VldTimeStamp tsHeader)
 ClassDef (DetSim, 2)

Private Attributes

SimDetectorfDetector
Int_t fRandomSeed
TRandom * fRandom
VldContext fContext
time_t fRunStartSecs
Int_t ncrates
TArrayI * workingcrates
TArrayI * cratesizeused
Int_t nwordsblock
TArrayI * workingarray
Int_t fRemoveFalseDigits
Int_t fBiggestSnarlOnly
SimFlag::SimFlag_t fContextSimFlag
Registry fDetectorConfiguration
Int_t fAddTimeWithinSec
 if non-zero => offset for time within second from VldContext
Int_t fAllowEmptyPEList
Int_t fCrateT0ns
 crate T0 nanoseconds
Int_t fAddNS
 ns to add
Int_t fAddQieTDC
 equivalent TDC counts for QIE
Int_t fAddVaTDC
 equivalent TDC counts for VA
TTree * fResultTree
TFile * fResultTreeFile

Detailed Description

Definition at line 37 of file DetSim.h.


Constructor & Destructor Documentation

DetSim::DetSim (  ) 

Definition at line 57 of file DetSim.cxx.

References SimDetector::DefaultConfig().

00058    : fDetector(0),
00059      fRandomSeed(0),
00060      fRandom(0), 
00061      fRunStartSecs(-1),
00062      ncrates(0), workingcrates(0), cratesizeused(0), workingarray(0),
00063      fRemoveFalseDigits(1),
00064      fBiggestSnarlOnly(1),
00065      fContextSimFlag(SimFlag::kMC),
00066      fAddTimeWithinSec(0),
00067      fAllowEmptyPEList(0),
00068      fAddNS(0),
00069      fAddQieTDC(0),
00070      fAddVaTDC(0)
00071 {
00072    // construct a new "DetSim" JobControl module
00073 
00074    // we'll use a random # generator to set fake "trigbits"
00075    // the generator can live as long as the module
00076    fRandom = new TRandom3();
00077 
00078    ncrates = 128;
00079    cratesizeused  = new TArrayI(ncrates);
00080    workingcrates  = new TArrayI [ncrates];
00081 
00082    Int_t init_alloc = 5 + 100*3;
00083    for (Int_t i=0; i<ncrates; i++) {
00084       cratesizeused->AddAt(0,i);
00085       workingcrates[i].Set(init_alloc);
00086    }
00087 
00088    nwordsblock = 0;
00089    workingarray = new TArrayI(2);
00090 
00091    fDetectorConfiguration.UnLockValues();
00092    fDetectorConfiguration = SimDetector::DefaultConfig();
00093 
00094    fResultTree = 0;
00095    fResultTreeFile = 0;
00096 }

DetSim::~DetSim (  ) 

Definition at line 100 of file DetSim.cxx.

References cratesizeused, fDetector, fRandom, fResultTree, fResultTreeFile, Msg::kInfo, Msg::kVerbose, MSG, ncrates, workingarray, and workingcrates.

00101 {
00102   MSG("DetSim", Msg::kVerbose) << "DetSim::Destructor\n";
00103   
00104   if(fDetector) delete fDetector;
00105   if (fRandom) delete fRandom;
00106   fRandom = 0;
00107 
00108   if (ncrates) {
00109      delete [] workingcrates;
00110      workingcrates = 0;
00111 
00112      delete cratesizeused;
00113      cratesizeused = 0;
00114 
00115      ncrates = 0;
00116   }
00117 
00118   if (workingarray) delete workingarray;
00119   workingarray = 0;
00120 
00121   if(fResultTree) {
00122     MSG("DetSim",Msg::kInfo) << "Closing DetSim Ana file." << endl;
00123     fResultTreeFile->cd();
00124     fResultTree->Write();
00125     fResultTreeFile->Write();
00126     fResultTreeFile->Close();
00127     delete fResultTreeFile;
00128     fResultTreeFile = 0;
00129   }
00130 }


Member Function Documentation

void DetSim::AddToCrate ( VldContext context,
const RawChannelId rcid,
Int_t  iadc,
Int_t  itdc,
Bool_t  error = false,
Int_t  truth_info = 0 
) [private]

Definition at line 558 of file DetSim.cxx.

References cratesizeused, fAddQieTDC, fAddVaTDC, fCrateT0ns, RawChannelId::GetCrate(), RawChannelId::GetElecType(), VldTimeStamp::GetSec(), VldContext::GetTimeStamp(), Msg::kError, Msg::kFatal, ElecType::kQIE, ElecType::kVA, MSG, ncrates, PackQieDigit(), PackVaDigit(), and workingcrates.

Referenced by Get().

00563 {
00564    // Add this entry into the crate array
00565 
00566    Int_t crate = rcid.GetCrate();
00567    if (crate>=ncrates) {
00568       MSG("DetSim",Msg::kFatal) 
00569          << "DetSim::AddToCrate "
00570          << crate << " larger than allocated " << ncrates << endl;
00571       return;
00572    }
00573 
00574    TArrayI *wcrate = &workingcrates[crate];
00575 
00576    //  Crate block format is:
00577    //-------------------------
00578    //   0: Crate #
00579    //   1: # ndigits in crate (N)
00580    //   2: GPS T0 sec
00581    //   3: GPS T0 nsec
00582    //   4: readout 1 word 1
00583    //   5: readout 1 word 2
00584    //   6: PlexStripEndId.fEncoded truth
00585    //   7: readout 2 word 1
00586    //   8: readout 2 word 2
00587    //   9: PlexStripEndId.fEncoded truth
00588 
00589    const Int_t hsize        = 4; // header size
00590    const Int_t ndigits_indx = 1; // index for pair count
00591    const Int_t nw_digit     = 3; // 3 words per digit
00592 
00593    // if allocated size is too small make it bigger
00594    Int_t used = cratesizeused->At(crate);
00595    Int_t need = used + nw_digit;  // each new entry adds three words
00596    if (0 == used) need += hsize;
00597 
00598    const Int_t slop = 100; // min extra allocation
00599 
00600    if (wcrate->GetSize() < need) {
00601       wcrate->Set(need+slop);
00602    }
00603 
00604    // add in header stuff if necessary
00605    if (0 == used) {
00606       // crate # + ped/common modes + electronics flag
00607       const Int_t modes = 0x07;
00608       Int_t etype = rcid.GetElecType();
00609       Int_t packedCrate = (modes << 8) |
00610          (etype << 6) | (crate & 0x0000003f);
00611       wcrate->AddAt(packedCrate,used++);
00612       // # digits
00613       if (used != ndigits_indx) {
00614          // this should never happen
00615          MSG("DetSim",Msg::kFatal) 
00616             << "DetSim::AddToCrate ndigits_indx "
00617             << ndigits_indx << " != " << used << endl;
00618       }
00619       wcrate->AddAt(0,used++);
00620       // GPS T0 (sec,nsec)
00621       VldTimeStamp vts = context.GetTimeStamp();
00622       wcrate->AddAt(vts.GetSec(),used++);
00623       // The fine time stamp corresponds to the start of the timeframe, not the event.
00624       wcrate->AddAt(fCrateT0ns,used++); 
00625       // Used to be: wcrate->AddAt(vts.GetNanoSec(),used++);
00626    }
00627 
00628    // Pack in data words.
00629    switch( rcid.GetElecType() ) {
00630    case ElecType::kVA:
00631      PackVaDigit(used, *wcrate, rcid, adc, tdc+fAddVaTDC, error, truth_info);
00632      break;
00633    case ElecType::kQIE:
00634      PackQieDigit(used, *wcrate, rcid, adc, tdc+fAddQieTDC, error, truth_info);
00635      break;
00636    default:
00637      // This shouldn't happen.
00638      MSG("DetSim",Msg::kError) << "DetSim: Unknown electronics type! Cannot pack digit!" << endl;
00639    }
00640 
00641    // update pair count
00642    Int_t npairs = (used-hsize)/nw_digit;
00643    wcrate->AddAt(npairs,ndigits_indx);
00644 
00645    // update used size
00646    cratesizeused->AddAt(used,crate);
00647 }

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 425 of file DetSim.cxx.

References fDetector, RecDataRecord< T >::FindComponent(), RecDataRecord< T >::FindTemporary(), MomNavigator::FragmentIter(), fResultTree, fResultTreeFile, SimDetector::GetEventResult(), DigiPE::GetTime(), JobCResult::kAOK, Msg::kError, Msg::kInfo, JobCResult::kWarning, MSG, and SimEventResult::npe.

00426 {
00427   // A test job for "reconstruction"
00428 
00429 
00430   SimSnarlRecord* simsnarl = 0;
00431   TObject* tobj;
00432   TIter    fragiter = mom->FragmentIter();
00433 
00434   // Get the simsnarl.
00435   while( ( tobj = fragiter.Next() ) ) {
00436     simsnarl = dynamic_cast<SimSnarlRecord*>(tobj);
00437     if(simsnarl) break;
00438   }
00439   const TObjArray* peListObj = 0;
00440   peListObj = 
00441     dynamic_cast<const TObjArray*>(simsnarl->FindTemporary(0,"DigiListPe"));
00442 
00443   if(peListObj == 0) {
00444     // Not there? See if it's listed as a permanent object.
00445     MSG("DetSim",Msg::kInfo) << "DigiPE list is not marked as temporary. Try Permanent." << endl;
00446     peListObj = 
00447       dynamic_cast<const TObjArray*>(simsnarl->FindComponent(0,"DigiListPe"));
00448   }
00449 
00450   if(peListObj == 0) {
00451     MSG("DetSim",Msg::kError) << "Cannot find DigiPE list in the SimSnarl. Aborting." << endl;
00452     return JobCResult::kWarning;
00453   }
00454 
00455   const DigiPE* digipe = NULL;
00456   Double_t earliest = 1e10;
00457 
00458   TObjArrayIter itr(peListObj);
00459   while( (digipe = dynamic_cast<DigiPE*>(itr.Next()))!=0 ) {
00460     if(digipe->GetTime() < earliest) earliest = digipe->GetTime();
00461     fDetector->GetEventResult().npe++;
00462   };
00463 
00465   // Fill a tree with some summary data.
00466   static SimEventResult* result_ptr;
00467   result_ptr = &(fDetector->GetEventResult());
00468   if( fResultTreeFile==0 ) {
00469     fResultTreeFile = new TFile("detsim_stats.root","RECREATE");
00470     fResultTree = new TTree("detsim","detsim");
00471     
00472     fResultTree->Branch("result","SimEventResult",&result_ptr,32000,1);
00473     fResultTree->Write("detsim");
00474     fResultTree->Print();
00475   }
00476   fResultTree->Fill();
00477   
00478                                                      
00479   // The following is example code for 
00480   // how to look at truth info.
00481   /*
00482     
00483 
00484   // Make a table of the DigiSignals if they exist.
00485   std::map<UInt_t,const DigiSignal*> signalMap;
00486 
00487   const TObjArray* signalArray = 
00488     dynamic_cast<const TObjArray*>(simsnarl->FindComponent(0,"DigiSignal"));
00489   if(signalArray) {
00490     TIter signalIter(signalArray);
00491     while( (tobj = signalIter.Next()) ) {
00492       const DigiSignal* signal = dynamic_cast<DigiSignal*>(tobj);
00493       if(signal) signalMap[signal->GetId()] = signal;
00494     }
00495   }  
00496   MSG("DetSim",Msg::kDebug) << "Got " << signalMap.size() << " signals." << endl;
00497   
00498   // Get the RawDigitDataBlock.
00499   const RawHeader* rawhead =0;
00500   const RawDigitDataBlock* rddb =0;
00501 
00502   fragiter.Reset();
00503   while( ( tobj = fragiter.Next() ) ) {
00504     RawRecord* rawRec = dynamic_cast<RawRecord*>(tobj);
00505     if(rawRec) {
00506       rawhead = rawRec->GetRawHeader();
00507       TIter itr = rawRec->GetRawBlockIter();
00508       RawDataBlock* rawBlk;
00509       while ( ( rawBlk = dynamic_cast<RawDataBlock*>(itr.Next()) ) ) {
00510         rddb = dynamic_cast<RawDigitDataBlock*>(rawBlk);
00511         if(rddb) break;
00512       }
00513     }
00514   }
00515 
00516   if(rddb) {
00517     TIter rditer = rddb->GetDatumIter();
00518     while( ( tobj = rditer.Next() ) ) {
00519       RawDigit*        rawDigit = dynamic_cast<RawDigit *>(tobj);
00520       RawDigiDigitMixIn* rawMCDigit = dynamic_cast<RawDigiDigitMixIn*>(tobj);
00521       
00522       if(rawDigit) 
00523         MSG("DetSim",Msg::kDebug) << "Digit: " << *rawDigit << endl;
00524       if(rawMCDigit) {
00525         UInt_t id = (UInt_t) rawMCDigit->GetDigiSignalIndex();
00526         if(signalMap.find(id)!=signalMap.end())
00527           MSG("DetSim",Msg::kDebug) << "  Signal: " 
00528                << "(Id: " << id << " ) "
00529                << "("       << signalMap[id]->GetCharge()/Munits::fC << " fC)\t"
00530                << "(truth=" << signalMap[id]->GetTruth() << ")\t"
00531                << "("       << signalMap[id]->GetNumberOfHits() << " hits)\t"
00532                << "("       << signalMap[id]->GetNumPes() << " PE)"
00533                << endl;
00534       }
00535     }
00536   }
00537   */
00538 
00539   return JobCResult::kAOK;
00540 }

void DetSim::CalculateAddTDC ( VldTimeStamp  tsHeader  )  [private]

Definition at line 1018 of file DetSim.cxx.

References fAddNS, fAddQieTDC, fAddVaTDC, fContext, fCrateT0ns, fDetector, VldContext::GetDetector(), VldTimeStamp::GetNanoSec(), Calibrator::GetTDCFromTime(), SimDetector::GetTimeShift(), Calibrator::Instance(), Msg::kInfo, ElecType::kQIE, ElecType::kVA, MAXMSG, and Munits::ns.

Referenced by Get().

01019 {
01020   // calculate what offset in TDCs are needed to simulate events taht
01021   // aren't relative to the start of a second
01022   // This is is necessary if we want to simulate exactly the real spill times
01023 
01024   // Ideally we'd just offset by the "trigger time" that is the header
01025   // but alas, due to a bug in the online code, that time has crateT0 
01026   // added to it.
01027   // Also, we might have shifted times to make all TDC values positive
01028   // (not knowing that we'd be making this adjustment)
01029   // so undo that to the extent that we can ...
01030   
01031   fAddNS = tsHeader.GetNanoSec() - fCrateT0ns;
01032   
01033   Double_t timeShift = fDetector->GetTimeShift();
01034   Double_t secAdj = ( fAddNS * Munits::ns ) - timeShift;
01035 
01036   if ( fDetector->GetTimeShift() > 0 ) {
01037     MAXMSG("DetSim",Msg::kInfo,10) 
01038       << " CalculateAddTDC timeShift (>0) " << timeShift << " ns," 
01039       << " fAddNS " << fAddNS << " crateT0ns " << fCrateT0ns << std::endl;
01040   }
01041 
01042   if ( secAdj < 0 ) {
01043     // can't do anything .. would shift negative
01044     secAdj = 0;
01045     fAddQieTDC = 0;
01046     fAddVaTDC  = 0;
01047     return;
01048   }
01049 
01050   // Calibrator::GetTDCFromTime converts time (Munits=sec) to TDC ticks
01051   // it does not calibrate; it also doesn't use anything from the
01052   // RawChannelId except ElecType()
01053 
01054   RawChannelId rcidQIE(fContext.GetDetector(),ElecType::kQIE,0,0);
01055   RawChannelId rcidVA(fContext.GetDetector(),ElecType::kVA,0,0);
01056 
01057   fAddQieTDC = Calibrator::Instance().GetTDCFromTime(secAdj,rcidQIE);
01058   fAddVaTDC  = Calibrator::Instance().GetTDCFromTime(secAdj,rcidVA);
01059 
01060 }

DetSim::ClassDef ( DetSim  ,
 
) [private]

Reimplemented in DigiPEtoRawDigitModule.

void DetSim::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 994 of file DetSim.cxx.

References SimDetector::Config(), fAddTimeWithinSec, fAllowEmptyPEList, fBiggestSnarlOnly, fContextSimFlag, fDetector, fDetectorConfiguration, fRandomSeed, fRemoveFalseDigits, Registry::Get(), SimFlag::kUnknown, Registry::Merge(), and Detector::StringToEnum().

00995 {
00996   fDetectorConfiguration.Merge(r);
00997   
00998   r.Get("removeFalseDigits",fRemoveFalseDigits);
00999   r.Get("biggestSnarlOnly",fBiggestSnarlOnly);
01000   r.Get("randomSeed",fRandomSeed);
01001   r.Get("addTimeWithinSec",fAddTimeWithinSec);
01002   r.Get("allowEmptyPEList",fAllowEmptyPEList);
01003   const char* tmps;
01004   if(r.Get("contextSimFlag",tmps)) { 
01005     SimFlag::SimFlag_t tsimflag = SimFlag::StringToEnum(tmps);
01006     if(tsimflag!=SimFlag::kUnknown) fContextSimFlag = tsimflag;
01007   }
01008 
01009   if(fDetector) fDetector->Config(fDetectorConfiguration);
01010 }

const Registry & DetSim::DefaultConfig ( void   )  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 968 of file DetSim.cxx.

References SimFlag::AsString(), fRandomSeed, JobCModule::GetName(), SimFlag::kMC, Registry::Merge(), Registry::Set(), and Registry::UnLockValues().

00969 {
00970   static Registry r;
00971 
00972   // Set name of config
00973   std::string name = this->GetName();
00974   name += ".config.default";
00975   r.SetName(name.c_str());
00976   
00977   // Set values in configuration
00978   r.UnLockValues();
00979   
00980   r.Set("removeFalseDigits",1);
00981   r.Set("biggestSnarlOnly",1);
00982   r.Set("contextSimFlag",SimFlag::AsString(SimFlag::kMC));
00983   r.Set("randomSeed",fRandomSeed);
00984 
00985   r.Set("addTimeWithinSec",0);
00986   r.Set("allowEmptyPEList",0);
00987 
00988   const Registry& r_simdet = SimDetector::DefaultConfig();
00989   r.Merge(r_simdet);
00990 
00991   return r;
00992 }

RawDataBlock * DetSim::FinalizeWorkingArray ( VldContext context  )  [private]

Definition at line 881 of file DetSim.cxx.

References bfld::AsString(), cratesizeused, RawBlockProxy::CreateRawDataBlock(), VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldContext::GetSimFlag(), RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), Msg::kDebug, Msg::kError, RawBlockRegistry::LookUp(), MSG, ncrates, nwordsblock, rdxsum_fill(), workingarray, and workingcrates.

Referenced by Get().

00882 {
00883    // Build final array from crate arrays
00884 
00885    //  Block format is:
00886    //---------------------
00887    //  # words in block
00888    //  checksum
00889    //  Block Id
00890    //  Crate #
00891    //  GPS T0 sec
00892    //  GPS T0 nsec
00893    //  Crate status
00894    //  # pairs in crate (N)
00895    //  readout 1 word 1
00896    //  readout 1 word 2
00897    //   < truth PlexStripEndId if Reroot data>
00898    //  readout 2 word 1
00899    //  readout 2 word 2
00900    //  ...
00901    //  readout N word 1
00902    //  readout N word 2
00903    //  Crate #
00904    //  GPS T0 sec
00905    //  GPS T0 nsec
00906    //  Crate status
00907    //  # pairs in crate (N)
00908    //  readout 1 word 1
00909 
00910    Int_t need = 3;  // #words, checksum, blockid
00911    for (Int_t crate=0; crate < ncrates; crate++) {
00912       need += cratesizeused->At(crate);
00913    }
00914 
00915    // float to highwater mark without copying contents
00916    if (workingarray->GetSize() < need) {
00917       workingarray->Set(0);    // deletes old array
00918       workingarray->Set(need); // set to necessary size
00919    }
00920 
00921    RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00922    RawBlockProxy*    rbp = rbr.LookUp("RawDigitDataBlock");
00923 
00924    Bool_t isDCS   = rbp->IsDCS();
00925    Int_t  majorId = rbp->GetMajorId();
00926 
00927    RawBlockProxy*    rbp2 = rbr.LookUp(isDCS,majorId);
00928    if ( rbp2 != rbp ) MSG("DetSim",Msg::kError) << "RawBlockProxy cross check failed" << endl;
00929 
00930    Int_t  minorId = 0;
00931    RawBlockId rbid(majorId,minorId,isDCS,context.GetDetector(),context.GetSimFlag());
00932    MSG("DetSim", Msg::kDebug)
00933       << " to be stored with RawBlockId " 
00934       << " 0x" << hex << rbid.GetEncoded() << dec
00935       << " == " << rbid.AsString() << endl
00936       << " majorId " << majorId << " minorId " << minorId
00937       << ((isDCS) ? " DCS " : " DAQ ")
00938       << " " << Detector::AsString(context.GetDetector()) << endl;
00939 
00940    Int_t checksum = 0xdeadbeef;
00941 
00942    Int_t& indx = nwordsblock;  // set "next" index to # words in block
00943    indx = 0;
00944    workingarray->AddAt(need,indx++);
00945    workingarray->AddAt(checksum,indx++);
00946    workingarray->AddAt(rbid.GetEncoded(),indx++);
00947    for (Int_t crate=0; crate<ncrates; crate++) {
00948       Int_t csize = cratesizeused->At(crate);
00949       TArrayI *wcrate = &workingcrates[crate];
00950       Int_t   *array  = wcrate->GetArray();  // gawd, it's guts are public
00951       for (Int_t i=0; i<csize; i++) {
00952          workingarray->AddAt(array[i],indx++);
00953       }
00954    }     
00955    
00956    // fill in the true checksum
00957    int xsum_version = 0;
00958    rdxsum_fill((int32_t*)workingarray->GetArray(),xsum_version);
00959    
00960    // use the proxy to actually create a block
00961    return rbp->CreateRawDataBlock(workingarray->GetArray());
00962 
00963 }

JobCResult DetSim::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 134 of file DetSim.cxx.

References SimDetector::AddDigiPEList(), SimEventResult::addNS, SimEventResult::addQieTDC, AddToCrate(), SimEventResult::addVaTDC, RecDataRecord< T >::AdoptComponent(), MomNavigator::AdoptFragment(), RawRecord::AdoptRawBlock(), RecJobHistory::Append(), VldTimeStamp::AsString(), CalculateAddTDC(), SimDetector::Config(), RecJobHistory::CreateJobRecord(), digit(), SimEventResult::event, fAddNS, fAddQieTDC, fAddTimeWithinSec, fAddVaTDC, fAllowEmptyPEList, fBiggestSnarlOnly, fContext, fContextSimFlag, fCrateT0ns, fDetector, fDetectorConfiguration, FinalizeWorkingArray(), RecDataRecord< T >::FindComponent(), RecDataRecord< T >::FindTemporary(), MomNavigator::FragmentIter(), fRandom, fRandomSeed, fRemoveFalseDigits, fRunStartSecs, SimDigit::GetADC(), SimDetector::GetBiggestSnarl(), VldTimeStamp::GetBOT(), VldContext::GetDetector(), SimDigitList::GetDigit(), RecDataHeader::GetErrorCode(), SimDigit::GetErrors(), SimDetector::GetEventResult(), minos::GetFromWhiteBoard(), DigiSignal::GetId(), RecRecordImp< T >::GetJobHistory(), RecMinos::GetJobHistory(), VldTimeStamp::GetNanoSec(), SimDetector::GetNumberOfDigits(), RawDigitDataBlock::GetNumberOfDigits(), SimDetector::GetNumberOfSnarls(), SimDetector::GetRandom(), SimDigit::GetRawChannelId(), RecDataHeader::GetRun(), RecDataHeader::GetRunType(), VldTimeStamp::GetSec(), SimDigit::GetSignal(), SimDetector::GetSimDigit(), VldContext::GetSimFlag(), SimSnarlRecord::GetSimSnarlHeader(), SimDetector::GetSnarl(), RecPhysicsHeader::GetSnarl(), SimDetector::GetSnarlList(), RecDataHeader::GetSubRun(), SimDigit::GetTDC(), RecMinos::GetTempTags(), RecPhysicsHeader::GetTimeFrame(), VldContext::GetTimeStamp(), SimSnarl::GetTriggerSource(), SimSnarl::GetTriggerTime(), RecHeader::GetVldContext(), InitWorkingArray(), Calibrator::Instance(), MsgService::Instance(), Msg::kDebug, Msg::kError, JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, RecJobHistory::kRaw, JobCResult::kWarning, Msg::kWarning, MAXMSG, MSG, Munits::ns, SimDetector::Print(), SimDetector::Reset(), CalScheme::Reset(), run(), SimEventResult::run, Registry::Set(), RecHeader::SetVldContext(), SimDetector::Simulate(), and SimDigitList::Size().

00135 {
00136   // Simulate the PMTs and electronics and make a RawRecord.
00137 
00138   // Get the SimSnarl
00139   SimSnarlRecord* simsnarl = 0;
00140   TObject* tobj;
00141   TIter    fragiter = mom->FragmentIter();
00142   while( ( tobj = fragiter.Next() ) ) {
00143     simsnarl = dynamic_cast<SimSnarlRecord*>(tobj);
00144     if(simsnarl) break;
00145   }
00146 
00147   if(simsnarl ==0){
00148     MSG("DetSim",Msg::kError)
00149       << "Cannot find SimSnarl! Aborting this event!" << endl;
00150     return JobCResult::kWarning;
00151   }
00152 
00153    const TObjArray* peListObj = 0;
00154   peListObj = 
00155     dynamic_cast<const TObjArray*>(simsnarl->FindTemporary(0,"DigiListPe"));
00156 
00157   if(peListObj == 0) {
00158     // Not there? See if it's listed as a permanent object.
00159     MSG("DetSim",Msg::kInfo) 
00160       << "DigiPE list is not marked as temporary. Try Permanent." << endl;
00161     peListObj = 
00162       dynamic_cast<const TObjArray*>(simsnarl->FindComponent(0,"DigiListPe"));
00163   }
00164 
00165   if(peListObj == 0) {
00166     if ( ! fAllowEmptyPEList ) {
00167       MSG("DetSim",Msg::kError) 
00168         << "Cannot find DigiPE list in the SimSnarl. Aborting." << endl;
00169       return JobCResult::kWarning;
00170     } else {
00171       MAXMSG("DetSim",Msg::kWarning,10)
00172         << "Cannot find DigiPE list in the SimSnarl. Continuing anyway." 
00173         << endl;
00174     }
00175   }
00176 
00177   const SimSnarlHeader* simHeader = simsnarl->GetSimSnarlHeader();
00178   if(simHeader ==0){
00179     MSG("DetSim",Msg::kError) << "Cannot find SimSnarlHeader. Aborting." << endl;
00180     return JobCResult::kWarning;
00181   }
00182 
00183   // For a PlexHandle we need a context
00184   fContext = simHeader->GetVldContext();
00185 
00186   // But we don't like this context.  We want it as an MC context,
00187   // not Reroot.
00188   fContext = VldContext(simHeader->GetVldContext().GetDetector(),
00189                         fContextSimFlag,
00190                         simHeader->GetVldContext().GetTimeStamp()
00191                         );
00192 
00193   // Reset the Calibrator.
00194   Calibrator::Instance().Reset(fContext);
00195 
00196   // Get a PlexHandle for PlexStripEndId to RawChannelId conversions
00197   PlexHandle ph(fContext);
00198   
00199   // Detector configuration. Make a new SimDetector,
00200   // or configure and reset the old one.
00201   if(fDetector==0){
00202     fDetector = new SimDetector(fContext,fRandom);
00203     fDetector->Config(fDetectorConfiguration);
00204   }
00205   fDetector->Reset(fContext);
00206 
00207   // Add all the PEs into the simulation.
00208   fDetector->AddDigiPEList(peListObj);
00209 
00210   // Set the random seed to match the event.
00211   // Also add some user-configurable randomness, in case they want to
00212   // generate the same event with a different outcome.
00213   fDetector->GetRandom()->SetSeed( simHeader->GetRun() 
00214                                    + simHeader->GetSnarl() 
00215                                    + fRandomSeed );
00216 
00217   // The money shot:
00218   fDetector->Simulate();
00219  
00220   // An array to hold DigiSignals.
00221   TObjArray* signalArray = new TObjArray(fDetector->GetNumberOfDigits());
00222   signalArray->SetOwner(true);
00223   signalArray->SetName("DigiSignal");
00224 
00226   // Copy out all digiSignals.
00227   for(int i=0;i<fDetector->GetNumberOfDigits();i++) {
00228     // Get each digitization, whether it made it through a trigger or not.
00229     const SimDigit* digit = fDetector->GetSimDigit(i);
00230     if(digit) {
00231       // This makes a copy of the signal.
00232       if(digit->GetSignal()) 
00233         signalArray->AddLast(new DigiSignal(*(digit->GetSignal())));
00234     }
00235   }
00236   // Add the truth data to the simsnarl
00237   simsnarl->AdoptComponent(signalArray);
00238 
00240   // Make a new RawDigitDataBlock for each SimSnarl
00241 
00242   Int_t snarls_written = 0;
00243 
00244   for(UInt_t iSnarl=0; iSnarl<fDetector->GetNumberOfSnarls(); iSnarl++) { // each snarl
00245 
00246     // Check to see if this is the biggest one. 
00247     // This removes 'crap' events from the stream. This is a stopgap measure.
00248     if(fBiggestSnarlOnly) {
00249       if(iSnarl != fDetector->GetBiggestSnarl()) {
00250         MSG("DetSim",Msg::kInfo) << "Throwing out a snarl with "
00251                                  << fDetector->GetSnarl(iSnarl).Size() 
00252                                  << " digits." << endl;
00253         continue;
00254       }
00255     }
00256 
00257     //get non-const SimSnarl 
00258     //was:  const SimSnarl& snarl = fDetector->GetSnarl(iSnarl);
00259     SimSnarl& snarl = fDetector->GetSnarlList()[iSnarl];
00260 
00261     // Prepare to start by getting current REROOT pointers
00262     // and clearing out the working array
00263     InitWorkingArray();
00264     
00265     
00266     // Reset context with a slightly different timestamp.
00267     // This should make no DB change, but correctly gets
00268     // the trigger time, making this consistent with later
00269     // analyses.
00270     
00271     // RWH: we would actually like to use the ns part of the
00272     // initial time stamp to offset within the 1 sec time
00273     // but currently the snarl creation doesn't use this
00274     // and introducing it here would just confuse things.
00275 
00276     VldTimeStamp trigTime(fContext.GetTimeStamp().GetSec(),
00277                           (int)(snarl.GetTriggerTime()/Munits::ns));
00278 
00279 
00280     fCrateT0ns = 0;  // original behaviour
00281     fAddNS     = 0;
00282     fAddQieTDC = 0;
00283     fAddVaTDC  = 0;
00284     // if simulating spill triggers don't allow time to slew, but
00285     // preserve any delays
00286     if ( fAddTimeWithinSec ) {
00287       trigTime = fContext.GetTimeStamp();
00288       //snarl.SetTriggerTime(0);
00289       MSG("DetSim",Msg::kDebug) << "#slew fAddTimeWithinSec " 
00290                                 << trigTime.AsString("c") << " " 
00291                                 << snarl.GetTriggerTime() << endl;
00292       //  to keep absolute time offsets in place, retain ns part
00293       // hopefully someone has writen what we should use on the whiteboard
00294       VldTimeStamp crateT0(VldTimeStamp::GetBOT());
00295       minos::GetFromWhiteBoard("EvtInfo","CrateT0",crateT0);
00296       fCrateT0ns = crateT0.GetNanoSec();
00297 
00298       // fill in fAddNS, fAddQieTDC, fAddVTDC
00299       CalculateAddTDC(trigTime);
00300     }
00301 
00302     VldContext trigContext(fContext.GetDetector(),
00303                            fContext.GetSimFlag(),
00304                            trigTime);
00305     
00306     MSG("DetSim",Msg::kDebug) << "#slew Snarl " << iSnarl 
00307                              << " added with " << trigContext << endl;
00308 
00309     Int_t outSnarlHits = 0;
00310     
00311     for(UInt_t i=0;i<(snarl.Size());i++) {
00312       // Get each hit...
00313       const SimDigit* digit = snarl.GetDigit(i);
00314       
00315       // And tack 'em on.
00316       if(digit) {
00317         // This test looks for bits that are bad in some way,
00318         // e.g. failed the 2/36 varc trigger. Some studies
00319         // may find it useful to keep them. If so, they are flagged
00320         // with error bits.
00321         if( (digit->GetErrors()==0) || (fRemoveFalseDigits==0) ) {
00322           outSnarlHits++;
00330           AddToCrate( trigContext,
00331                       digit->GetRawChannelId(),
00332                       digit->GetADC(),
00333                       digit->GetTDC(),
00334                       digit->GetErrors(),
00335                       digit->GetSignal()->GetId()
00336                       );
00337         }
00338       }
00339     }
00340     
00341     MSG("DetSim",Msg::kDebug) << "Snarl " << iSnarl << " added with " << outSnarlHits << " hits\n";
00342     
00343     
00344     
00346     // Add the raw data to to the raw record.
00347     
00348     // Finalize the working array, produce RawDigitDataBlock
00349     RawDataBlock *rawblk = FinalizeWorkingArray(trigContext);
00350     RawDigitDataBlock *rrdb = dynamic_cast<RawDigitDataBlock*>(rawblk);
00351     
00352     // produce a RawDaqSnarlHeader (specialized RawHeader)
00353     // which the RawRecord will adopt
00354     
00355     if(fRunStartSecs<0) fRunStartSecs = fContext.GetTimeStamp().GetSec();
00356     
00357     Int_t   run      = simHeader->GetRun();
00358     Short_t subrun   = simHeader->GetSubRun();
00359     Short_t runtype  = simHeader->GetRunType();
00360     Int_t   timeframe= simHeader->GetTimeFrame(); // fContext.GetTimeStamp().GetSec() - fRunStartSecs;
00361     // by using Snarl # stored in SimSnarlHeader we avoid getting out of
00362     // synch.  drawback is potential for duplicates when triggering
00363     // splits a SimSnarl's data into two separate triggers
00364     Int_t   snarlNo  = simHeader->GetSnarl();
00365     Int_t   trigbits = snarl.GetTriggerSource();
00366     Int_t   errcode  = simHeader->GetErrorCode();
00367     Int_t   nrawdigits = (rrdb) ? rrdb->GetNumberOfDigits() : -1;
00368     Int_t   spilltype  = -1;
00369     
00370     RawDaqSnarlHeader *head = 
00371       new RawDaqSnarlHeader(trigContext,run,subrun,runtype,timeframe,
00372                             snarlNo,trigbits,errcode,nrawdigits,spilltype);
00373     
00374     // produce a RawRecord, have it adopt the header  
00375     RawRecord *rawrec = new RawRecord(head);
00376 
00377     RecJobHistory& jobhist 
00378                   = const_cast<RecJobHistory&>(rawrec->GetJobHistory());
00379     jobhist.Append(simsnarl->GetJobHistory());
00380     jobhist.CreateJobRecord(RecJobHistory::kRaw);
00381     
00382     // give the block to the RawRecord
00383     rawrec->AdoptRawBlock(rawblk);
00384     
00385     // tag this RawRecord AS IF it had come from the DaqSnarl stream
00386     rawrec->GetTempTags().Set("stream","DaqSnarl");
00387     
00388     
00389     // massage the simsnarl so it has the same time.
00390     SimSnarlHeader* varSimHeader = const_cast<SimSnarlHeader*>(simHeader);
00391     varSimHeader->SetVldContext(trigContext);
00392     
00393     // give the RawRecord to MOM to hold as a "fragment"
00394     mom->AdoptFragment(rawrec);
00395     
00396       snarls_written += 1;
00397   }
00398 
00399   SimEventResult& eventResult = fDetector->GetEventResult();
00400   eventResult.run = simHeader->GetRun();
00401   eventResult.event = simHeader->GetSnarl();
00402 
00403   eventResult.addNS     = fAddNS;
00404   eventResult.addQieTDC = fAddQieTDC;
00405   eventResult.addVaTDC  = fAddVaTDC;
00406 
00407   // Debugging only:
00408   if(MsgService::Instance()->GetStream("DetSim")->IsActive(Msg::kDebug)) {
00409     fDetector->Print();
00410   }
00411 
00412   // Add a copy of the event result to the simsnarl for later bookkeeping.
00413   simsnarl->AdoptComponent(new SimEventResult(eventResult));
00414 
00415   // Return true if a snarl comes out.
00416   if(snarls_written==0) return JobCResult::kFailed;
00417   
00418   // Return trigger result.
00419   return JobCResult::kPassed;
00420 }

void DetSim::InitWorkingArray ( void   )  [private]

Definition at line 544 of file DetSim.cxx.

References cratesizeused, ncrates, and nwordsblock.

Referenced by Get().

00545 {
00546    // Initialize for new "Get"
00547 
00548    // zero out used sizes ...
00549    for (Int_t i=0; i<ncrates; i++) {
00550       cratesizeused->AddAt(0,i);
00551    }
00552    nwordsblock = 0;
00553 }

void DetSim::PackQieDigit ( Int_t &  cptr,
TArrayI &  wcrate,
const RawChannelId rcid,
Int_t  iadc,
Int_t  itdc,
Bool_t  error = false,
Int_t  truth_info = 0 
) [private]

Definition at line 777 of file DetSim.cxx.

References extra(), RawChannelId::GetChAdd(), Msg::kFatal, RawQieDigit::kParityError, RawQieDigit::kSGate, Msg::kWarning, and MSG.

Referenced by AddToCrate().

00784 {
00785    // From RawQieDigit:
00786    //       3         2         1         0
00787    //      10987654321098765432109876543210
00788    //  U:  eeecccccccccccccaaaaaaaaaaaaaaaa   e=err, c=chan, a=adc
00789    //  L:  dddxxttttttttttttttttttttttttttt   d=datatype x=unused, t=tdc
00790    //  X:  PlexStripEndId::fEncoded
00791 
00792   const int adcmask    = 0x0000ffff;
00793   const int tdcmask    = 0x07ffffff;     
00794   const int chaddmask  = 0x00001fff;
00795   const int errshift  = 29;
00796   const int errmask   = 0x00000007;
00797   const int chanshift = 16;
00798   const int dtshift   = 29;
00799   const int dtmask    = 0x00000007;
00800 
00801   Int_t chadd   = rcid.GetChAdd( );
00802    if (chadd > chaddmask) {
00803       // this should never happen
00804       static int nmsg_chadd = 5;
00805       if (nmsg_chadd) {
00806          MSG("DetSim",Msg::kFatal) 
00807             << "DetSim::PackQieDigit chadd "
00808             << hex << chadd << dec << " truncated from " 
00809             << hex << rcid.GetChAdd() << dec << endl;
00810          nmsg_chadd--;
00811          if (nmsg_chadd==0) 
00812             MSG("DetSim",Msg::kFatal) 
00813                << " ... last of these messages" << endl;
00814       }
00815    }
00816    chadd &= chaddmask;
00817 
00818    Int_t iadc = adc;
00819    if ( (iadc > adcmask) || (iadc<0) ) {
00820       // this shouldn't happen too often.
00821       static int nmsg_adc = 5;
00822       if (nmsg_adc) {
00823          MSG("DetSim",Msg::kWarning) 
00824             << "DetSim::PackQieDigit() iadc "
00825             << iadc << " does not fit in field  (max " 
00826             << adcmask << ")" << endl;
00827          nmsg_adc--;
00828          if (nmsg_adc==0)
00829             MSG("DetSim",Msg::kWarning) 
00830                << " ... last of these messages" << endl;
00831       }     
00832       iadc = TMath::Max(0,TMath::Min(iadc,adcmask));
00833    }
00834    iadc &= adcmask;
00835 
00836    Int_t itdc = tdc;
00837    if (itdc < 0) {
00838      // -ve times are a bugger. wrap them to the correct value and hope 
00839      // the reconstruction can sort it out.
00840      itdc += 53097844; // The number of QIE ticks in one second.
00841    }
00842    if (itdc > tdcmask ) {
00843       // this should never happen
00844       static int nmsg_tdc = 5;
00845       if (nmsg_tdc) {
00846          MSG("DetSim",Msg::kWarning) 
00847             << "DetSim::PackQieDigit itdc "
00848             << itdc << " does not fit in field (max " 
00849             << tdcmask << ")" << endl;
00850          nmsg_tdc--;
00851          if (nmsg_tdc==0)
00852             MSG("DetSim",Msg::kWarning) 
00853                << " ... last of these messages" << endl;
00854       }     
00855       itdc = TMath::Max(0,TMath::Min(itdc,tdcmask));
00856    }
00857    itdc &= tdcmask;
00858    
00859    // Pack it up.
00860    int ierr = 0;
00861    if(error) ierr =  (RawQieDigit::kParityError) & errmask;
00862    
00863    // We assume that all ND data is spill mode.
00864    // This is the current assumption in the QIE model.
00865    int dtype = (RawQieDigit::kSGate) & dtmask;
00866    
00867    Int_t upper = (ierr<<errshift) | (chadd<<chanshift) | iadc;
00868    Int_t lower = (dtype<<dtshift) | itdc; 
00869    Int_t  extra = truth_info;
00870    
00871    // push the words in
00872    wcrate.AddAt(upper,cptr++);
00873    wcrate.AddAt(lower,cptr++);
00874    wcrate.AddAt(extra,cptr++);
00875 }

void DetSim::PackVaDigit ( Int_t &  cptr,
TArrayI &  wcrate,
const RawChannelId rcid,
Int_t  iadc,
Int_t  itdc,
Bool_t  error = false,
Int_t  truth_info = 0 
) [private]

Definition at line 651 of file DetSim.cxx.

References extra(), RawChannelId::GetChAdd(), Msg::kFatal, Msg::kWarning, and MSG.

Referenced by AddToCrate().

00658 {
00659    // From RawVaDigit:
00660    //       3         2         1         0
00661    //      10987654321098765432109876543210
00662    //  U:  1PWccccccccccccNsaaaaaaaaaaaaaa   X=common mode,c=chan, s=sign a=adc
00663    //  L:  0Pttttttttttttttttttttttttttttt   P=parity, t=tdc
00664    //  X:  PlexStripEndId::fEncoded
00665    // W = fifo or calinject warning condition (0=okay)
00666    // N = 1 for normal data taking (0=calinject or pedestal data)
00667 
00668   
00669   const int chaddmask  = 0x1fff;
00670   const int adcmask    = 0x00003fff;
00671   const int tdcmask    = 0x3fffffff;
00672   const int chaddshift = 16;
00673   const int adcsignbit  = 0x00004000;
00674   //const int adcsignext  = 0xffffc000;
00675   //const int adcsignshft = 14;
00676   const int wordbit    = 0x80000000;
00677   const int parityb    = 0x40000000;
00678   const int warnb      = 0x20000000;
00679   const int stddatab   = 0x00008000;
00680 
00681   // Pack channel address.
00682   Int_t chadd   = rcid.GetChAdd();
00683   if (chadd > chaddmask) {
00684     // this should never happen
00685     static int nmsg_chadd = 5;
00686     if (nmsg_chadd) {
00687          MSG("DetSim",Msg::kFatal) 
00688            << "DetSim::AddToCrate chadd "
00689            << hex << chadd << dec << " truncated from " 
00690            << hex << rcid.GetChAdd() << dec << endl;
00691          nmsg_chadd--;
00692          if (nmsg_chadd==0) 
00693            MSG("DetSim",Msg::kFatal) 
00694              << " ... last of these messages" << endl;
00695     }
00696   }
00697   chadd &= chaddmask;
00698   
00699   Int_t iadc = adc;
00700   // two's compliment.
00701   if(adc<0) iadc = (adcmask+1) - abs(adc);
00702 
00703   if (iadc > adcmask ) {
00704     // this shouldn't happen often.
00705     static int nmsg_adc = 5;
00706     if (nmsg_adc) {
00707       MSG("DetSim",Msg::kWarning) 
00708         << "DetSim::PackVaDigit() iadc "
00709         << iadc << " does not fit in field  (max " 
00710             << adcmask << ")" << endl;
00711       nmsg_adc--;
00712       if (nmsg_adc==0)
00713         MSG("DetSim",Msg::kWarning) 
00714           << " ... last of these messages" << endl;
00715     }     
00716       iadc = TMath::Max(0,TMath::Min(iadc,adcmask));
00717   }
00718   iadc &= adcmask;
00719   
00720   Int_t itdc = tdc;
00721   if (itdc < 0 ) { 
00722     // -ve times are a bugger.
00723     // Wrap the times around and hope that the reconstruction program can
00724     // fix it.
00725     itdc += 640000000; // Number of 16*40MHz ticks in a second.
00726   }
00727   else if (itdc > tdcmask ) {
00728     // this should never happen
00729     static int nmsg_tdc = 5;
00730     if (nmsg_tdc) {
00731       MSG("DetSim",Msg::kWarning) 
00732         << "DetSim::AddToCrate itdc "
00733         << itdc << " does not fit in field (max " 
00734         << tdcmask << ")" << endl;
00735       nmsg_tdc--;
00736       if (nmsg_tdc==0)
00737         MSG("DetSim",Msg::kWarning) 
00738           << " ... last of these messages" << endl;
00739     }     
00740     itdc = TMath::Max(0,TMath::Min(itdc,tdcmask));
00741   }
00742   itdc &= tdcmask;
00743   
00744   Int_t upper = stddatab | wordbit | (chadd<<chaddshift) | iadc;
00745   // Add sign bit.
00746   if(adc<0) upper |= adcsignbit;
00747   // Add error bit, if appropritate.
00748   if(error) upper |= warnb;
00749   
00750   Int_t lower = itdc;
00751   Int_t  extra = truth_info;
00752 
00753   // Compute parities.
00754   int sum1 = 0;
00755   int sum0 = 0;
00756   int v1 = upper; // upper word
00757   int v0 = lower; // lower word
00758   for (int j=0; j<32; j++) {
00759     sum1 += (v1&1);
00760     sum0 += (v0&1);
00761     v1 = v1 >> 1;
00762     v0 = v0 >> 1;
00763   }
00764   // If parities are odd, add a bit to make them even.
00765   
00766   if (sum1&1 !=0 ) upper |= parityb;
00767   if (sum0&1 !=0 ) lower |= parityb;
00768 
00769   // push the words in
00770   wcrate.AddAt(upper,cptr++);
00771   wcrate.AddAt(lower,cptr++);
00772   wcrate.AddAt(extra,cptr++);
00773 }

void DetSim::Report (  )  [virtual]

Implement to spew end of running report

Reimplemented from JobCModule.

Definition at line 1012 of file DetSim.cxx.

References fDetector, and SimDetector::Print().

01013 {
01014   if(fDetector) fDetector->Print();
01015   else JobCModule::Report();
01016 }


Member Data Documentation

TArrayI* DetSim::cratesizeused [private]

Definition at line 107 of file DetSim.h.

Referenced by AddToCrate(), FinalizeWorkingArray(), InitWorkingArray(), and ~DetSim().

Int_t DetSim::fAddNS [private]

ns to add

Definition at line 126 of file DetSim.h.

Referenced by CalculateAddTDC(), and Get().

Int_t DetSim::fAddQieTDC [private]

equivalent TDC counts for QIE

Definition at line 127 of file DetSim.h.

Referenced by AddToCrate(), CalculateAddTDC(), and Get().

Int_t DetSim::fAddTimeWithinSec [private]

if non-zero => offset for time within second from VldContext

Definition at line 122 of file DetSim.h.

Referenced by Config(), and Get().

Int_t DetSim::fAddVaTDC [private]

equivalent TDC counts for VA

Definition at line 128 of file DetSim.h.

Referenced by AddToCrate(), CalculateAddTDC(), and Get().

Int_t DetSim::fAllowEmptyPEList [private]

if non-zero proceed even if there isn't a DigiListPe this allows noise-only spills (desired for Minerva overlays)

Definition at line 123 of file DetSim.h.

Referenced by Config(), and Get().

Int_t DetSim::fBiggestSnarlOnly [private]

Definition at line 114 of file DetSim.h.

Referenced by Config(), and Get().

Definition at line 98 of file DetSim.h.

Referenced by CalculateAddTDC(), and Get().

Definition at line 116 of file DetSim.h.

Referenced by Config(), and Get().

Int_t DetSim::fCrateT0ns [private]

crate T0 nanoseconds

Definition at line 125 of file DetSim.h.

Referenced by AddToCrate(), CalculateAddTDC(), and Get().

Definition at line 67 of file DetSim.h.

Referenced by Ana(), CalculateAddTDC(), Config(), Get(), Report(), and ~DetSim().

Definition at line 118 of file DetSim.h.

Referenced by Config(), and Get().

TRandom* DetSim::fRandom [private]

Definition at line 96 of file DetSim.h.

Referenced by Get(), and ~DetSim().

Int_t DetSim::fRandomSeed [private]

Definition at line 95 of file DetSim.h.

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

Int_t DetSim::fRemoveFalseDigits [private]

Definition at line 113 of file DetSim.h.

Referenced by Config(), and Get().

TTree* DetSim::fResultTree [private]

Definition at line 131 of file DetSim.h.

Referenced by Ana(), and ~DetSim().

TFile* DetSim::fResultTreeFile [private]

Definition at line 132 of file DetSim.h.

Referenced by Ana(), and ~DetSim().

time_t DetSim::fRunStartSecs [private]

Definition at line 101 of file DetSim.h.

Referenced by Get().

Int_t DetSim::ncrates [private]

Definition at line 105 of file DetSim.h.

Referenced by AddToCrate(), FinalizeWorkingArray(), InitWorkingArray(), and ~DetSim().

Int_t DetSim::nwordsblock [private]

Definition at line 109 of file DetSim.h.

Referenced by FinalizeWorkingArray(), and InitWorkingArray().

TArrayI* DetSim::workingarray [private]

Definition at line 110 of file DetSim.h.

Referenced by FinalizeWorkingArray(), and ~DetSim().

TArrayI* DetSim::workingcrates [private]

Definition at line 106 of file DetSim.h.

Referenced by AddToCrate(), FinalizeWorkingArray(), and ~DetSim().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1