57 fWireHits(fWireHits_TEMP)
80 for (std::vector<QwHit>::iterator hit1=
fWireHits.begin(); hit1!=
fWireHits.end(); hit1++)
82 hit1->SetDriftDistance(
99 Bool_t data_integrity_flag =
false;
100 Bool_t temp_print_flag =
false;
108 if (bank_index>=0 && num_words>0) {
113 if (temp_print_flag ) {
114 std::cout <<
"QwDriftChamber::ProcessEvBuffer: "
115 <<
"Begin processing ROC"
120 <<
" Subbbank Index "
135 if (data_integrity_flag) {
137 for (UInt_t i=0; i<num_words ; i++) {
148 Int_t tdcindex =
GetTDCIndex(bank_index, tdc_slot_number);
150 if ( tdc_slot_number == 31) {
170 FillRawTDCWord(bank_index, tdc_slot_number, tdc_chan_number, tdc_data);
172 catch (std::exception&
e) {
173 std::cerr <<
"Standard exception from QwDriftChamber::FillRawTDCWord: "
174 << e.what() << std::endl;
175 std::cerr <<
" Parameters: index==" <<bank_index
176 <<
"; GetF1SlotNumber()==" <<tdc_slot_number
177 <<
"; GetF1ChannelNumber()=="<<tdc_chan_number
178 <<
"; GetF1Data()==" <<tdc_data
181 std::cerr <<
" GetTDCIndex()=="<<tdcindex
182 <<
"; fTDCPtrs.at(tdcindex).size()=="
184 <<
"; fTDCPtrs.at(tdcindex).at(chan).fPlane=="
185 <<
fTDCPtrs.at(tdcindex).at(tdc_chan_number).fPlane
186 <<
"; fTDCPtrs.at(tdcindex).at(chan).fElement=="
187 <<
fTDCPtrs.at(tdcindex).at(tdc_chan_number).fElement
240 std::cout<<
"RegisterSubbank()"
242 <<
" Subbank "<<bank_id
262 std::cerr <<
"QwDriftChamber::RegisterSlotNumber: Slot number "
263 << slot_id <<
" is larger than the number of slots per ROC, "
275 if ( slot_num <
fTDC_Index.at(bank_index).size()) {
276 tdcindex =
fTDC_Index.at(bank_index).at(slot_num);
304 Int_t bank_index = 0;
308 UInt_t vme_slot_num = 0;
310 std::cout <<
"QwDriftChamber Region : "
312 <<
"::ReportConfiguration fTDCPtrs.size() "
321 for ( j=0; j<
fBank_IDs.at(i).size(); j++ )
325 if(bank_flag == 0)
continue;
333 std::cout <<
"ROC [index, Num]["
336 << std::setw(2) << roc_num
338 <<
" Bank [index,id]["
352 vme_slot_num = slot_id;
355 <<
"Slot [id, VME num] ["
356 << std::setw(2) << slot_id
358 << std::setw(2) << vme_slot_num
360 if ( tdc_index == -1 ) {
368 << tdc_index << std::endl;
389 for ( j=0; j<(num_words/5); j++ )
391 printf (
"buffer[%5d] = 0x:", ipt );
392 for ( k=j; k<j+5; k++ ) {
393 printf (
"%12x", buffer[ipt++] );
398 if ( ipt<num_words ) {
399 printf (
"buffer[%5d] = 0x:", ipt );
400 for ( k=ipt; k<num_words; k++ )
402 printf (
"%12x", buffer[ipt++] );
414 const UInt_t bank_id,
419 TString subsystem_name;
421 Int_t bank_index = 0;
424 UInt_t vme_slot_num = 0;
433 <<
" local_f1tdc " << local_f1tdc <<
"\n";
440 std::cout <<
"-----------------------------------------------------" << std::endl;
442 std::cout <<
"\nQwDriftChamber : "
445 <<
"ProcessConfigurationBuffer"
448 << std::setw(2) << roc_id
449 <<
" Bank [index,id]["
462 vme_slot_num = slot_id;
465 <<
"Slot [id, VME num] ["
466 << std::setw(2) << slot_id
468 << std::setw(2) << vme_slot_num
476 if (tdc_index not_eq -1) {
478 if(local_f1tdc)
delete local_f1tdc; local_f1tdc = NULL;
480 local_f1tdc =
new QwF1TDC(roc_id, vme_slot_num);
489 std::cout <<
"F1TDC index "
501 std::cout <<
"Unused in "
505 <<
" local_f1tdc at "
513 if (slot_id == 0) std::cout <<
" ";
514 else if (slot_id == 1) std::cout <<
"MVME CPU ";
515 else std::cout <<
"Trigger Interface";
519 std::cout << std::endl;
526 std::cout <<
"-----------------------------------------------------" << std::endl;
Int_t GetSubbankIndex() const
std::vector< std::vector< Int_t > > fTDC_Index
void AddQwF1TDC(QwF1TDC *in)
std::vector< std::vector< Double_t > > fReferenceMaster
size_t fCurrentBankIndex
Name of this subsystem (the region).
F1TDCs configuration and reference siganls container.
void SetF1TDCBuffer(UInt_t *buffer, UInt_t num_words)
const UInt_t & GetTDCMaxChannels() const
void PrintConfigurationBuffer(UInt_t *buffer, UInt_t num_words)
void InitHistogramPointers()
void ClearAllBankRegistrations()
Double_t fF1TDCResolutionNS
static const UInt_t kMaxNumberOfSlotsPerROC
const UInt_t & GetTDCData() const
one F1TDC configuration and reference signal(s) holder
static const Int_t kCodaMasterPlaneNumber
Bool_t CheckDataIntegrity(const UInt_t roc_id, UInt_t *buffer, UInt_t num_words)
Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware v...
Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
static bool fPrintF1TDCConfiguration
const UInt_t & GetTDCSlotNumber() const
const UInt_t & GetTDCChannelNumber() const
A logfile class, based on an identical class in the Hermes analyzer.
Int_t LinkReferenceChannel(const UInt_t chan, const Int_t plane, const Int_t wire)
std::vector< std::vector< QwDetectorID > > fTDCPtrs
std::vector< std::pair< Int_t, Int_t > > fReferenceChannels
QwDriftChamber()
Private default constructor (not implemented, will throw linker error on use)
Double_t DoneF1TDCsConfiguration()
UInt_t kMaxNumberOfChannelsPerTDC
QwF1TDContainer * fF1TDContainer
Bool_t IsValidDataword() const
The pure virtual base class of all subsystems.
void SetF1BankIndex(const Int_t bank_index)
const MQwF1TDC GetF1TDCDecoder() const
virtual Double_t CalculateDriftDistance(Double_t drifttime, QwDetectorID detector)=0
void SetF1SystemName(const TString name)
std::vector< std::vector< Double_t > > fReferenceData
std::vector< std::vector< UInt_t > > fBank_IDs
Vector of Bank IDs per ROC ID associated with this subsystem.
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Int_t RegisterSubbank(const UInt_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...
Int_t RegisterSubbank(const UInt_t bank_id)
virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
void ReportConfiguration()
Int_t GetTDCIndex(size_t bank_index, size_t slot_num) const
std::vector< UInt_t > fROC_IDs
Vector of ROC IDs associated with this subsystem.
void SetF1TDCIndex(const Int_t tdc_index)
Int_t RegisterSlotNumber(const UInt_t slot_id)
static const Int_t kReferenceChannelPlaneNumber
An options class which parses command line, config file and environment.
virtual ~QwDriftChamber()
Virtual destructor.
Bool_t IsSlotRegistered(Int_t bank_index, Int_t slot_num) const
std::vector< QwHit > & fWireHits
void Print(const Option_t *options=0) const
void DecodeTDCWord(UInt_t &word, const UInt_t roc_id)
void FillDriftDistanceToHits()
virtual void FillRawTDCWord(Int_t bank_index, Int_t slot_num, Int_t chan, UInt_t data)=0
void ClearAllBankRegistrations()
Clear all registration of ROC and Bank IDs for this subsystem.
void FillHardwareErrorSummary()
Hardware error summary.
TString GetSubsystemName() const
Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id)
Tell the object that it will decode data from this ROC and sub-bank.
F1TDCReferenceContainer * fF1RefContainer
std::vector< std::vector< QwDetectorInfo > > fWireData
void SetDataLoaded(Bool_t flag)