Public Types | |
| typedef map< string, SwicBranch * > | SwicMap |
| typedef map< string, BpmBranch * > | BpmMap |
Public Member Functions | |
| bool | Fill (const RawBeamMonBlock *rbmb) |
Public Attributes | |
| TFile * | file |
| TTree * | tree |
| SwicMap | swics |
| BpmMap | bpms |
| TriggerBranch * | trig |
| string | trigname |
|
|
|
|
|
|
|
|
Definition at line 36 of file Bdnt.cxx. References bpms, BpmBranch::dae_msec, SwicBranch::dae_msec, BpmBranch::dae_sec, SwicBranch::dae_sec, BpmBranch::dae_ts, SwicBranch::dae_ts, RawBeamData::GetData(), RawBeamData::GetDataLength(), RawBeamData::GetMsecs(), RawBeamMonBlock::GetNames(), RawBeamData::GetSeconds(), TriggerBranch::in_spill, RawBeamPosData::IsValid(), RawBeamSwicData::IsValid(), TriggerBranch::msec, TriggerBranch::sec, RawBeamPosData::SetData(), RawBeamSwicData::SetData(), swics, RawBeamMonBlock::TclkTriggerDelay(), TriggerBranch::timesince, trigname, TriggerBranch::ts, BpmBranch::vme_msec, SwicBranch::vme_msec, BpmBranch::vme_sec, SwicBranch::vme_sec, BpmBranch::vme_ts, SwicBranch::vme_ts, RawBeamPosData::VmeNanoseconds(), RawBeamSwicData::VmeNanoseconds(), RawBeamPosData::VmeSeconds(), and RawBeamSwicData::VmeSeconds(). Referenced by Bdnt::ProcessFile(). 00037 {
00038 #if 0
00039 vector<string> namelist = rbmb->GetNames();
00040 for (size_t ind=0; ind<namelist.size(); ++ ind)
00041 cout << namelist[ind] << " ";
00042 cout << endl;
00043 #endif
00044
00045 // fill trigger info
00046 TriggerBranch* trig_br = trig;
00047 memset(trig_br,0,sizeof(TriggerBranch));
00048
00049 const int delay = rbmb->TclkTriggerDelay();
00050 if (delay < 1000)
00051 trig_br->in_spill = 1;
00052 else trig_br->in_spill = 0;
00053
00054 const RawBeamData* rbd = (*rbmb)[trigname];
00055 if (rbd) {
00056 trig_br->sec = rbd->GetSeconds();
00057 trig_br->msec = rbd->GetMsecs();
00058 trig_br->ts = (1.0*trig_br->sec) + (trig_br->msec/1000.0);
00059 if (rbd->GetDataLength())
00060 trig_br->timesince = rbd->GetData()[0];
00061 else
00062 cerr << "Empty data for tigger snc " << trigname << endl;
00063 }
00064 else {
00065 //cerr << "No trigger snc device " << trigname << endl;
00066 }
00067
00068 // fill swic info
00069 RawBeamSwicData swic;
00070 SwicMap::iterator sit, sdone = swics.end();
00071 for (sit=swics.begin(); sit != sdone; ++sit) {
00072 string swic_name = sit->first;
00073 SwicBranch* swic_br = sit->second;
00074
00075 memset(swic_br,0,sizeof(SwicBranch));
00076
00077 const RawBeamData* rbd = (*rbmb)[swic_name.c_str()];
00078 if (!rbd) {
00079 //cerr << "No SWIC data for " << swic_name << endl;
00080 return false;
00081 }
00082
00083 swic.SetData(*rbd);
00084 if (!swic.IsValid()) {
00085 cerr << "Not valid SWIC data for " << swic_name << endl;
00086 return false;
00087 }
00088
00089 int sec = rbd->GetSeconds();
00090 int msec = rbd->GetMsecs();
00091 double dst = (1.0*sec) + (msec/1000.0);
00092 swic_br->dae_sec = sec;
00093 swic_br->dae_msec = msec;
00094 swic_br->dae_ts = dst;
00095
00096 int vsec = swic.VmeSeconds();
00097 int vmsec = swic.VmeNanoseconds()/1000000;
00098 double vme = (1.0*vsec) + (vmsec/1000.0);
00099 swic_br->vme_sec = vsec;
00100 swic_br->vme_msec = vmsec;
00101 swic_br->vme_ts = vme;
00102 #if 0
00103 cout.precision(20);
00104 cout << "SWIC: " << swic_name
00105 << " VME@ " << vsec << "." << vmsec << " = " << vme << ", DAE@"
00106 << sec << "." << msec << " = " << dst << endl;
00107 cout << rbd->GetData()[205] << " "
00108 << rbd->GetData()[206] << " "
00109 << rbd->GetData()[207] << " "
00110 << rbd->GetData()[208] << endl;
00111 #endif
00112 }
00113
00114 // fill bpm info
00115 RawBeamPosData bpm;
00116 BpmMap::iterator pit, pdone = bpms.end();
00117 for (pit=bpms.begin(); pit != pdone; ++pit) {
00118 string bpm_name = pit->first;
00119 BpmBranch* bpm_br = pit->second;
00120
00121 memset(bpm_br,0,sizeof(BpmBranch));
00122
00123 const RawBeamData* rbd = (*rbmb)[bpm_name.c_str()];
00124 if (!rbd) {
00125 //cerr << "No BPM data for " << bpm_name << endl;
00126 return false;
00127 }
00128
00129 bpm.SetData(*rbd);
00130 if (!bpm.IsValid()) {
00131 cerr << "Not valid BPM data for " << bpm_name << endl;
00132 return false;
00133 }
00134
00135 int sec = rbd->GetSeconds();
00136 int msec = rbd->GetMsecs();
00137 double dst = (1.0*sec) + (msec/1000.0);
00138 bpm_br->dae_sec = sec;
00139 bpm_br->dae_msec = msec;
00140 bpm_br->dae_ts = dst;
00141
00142 int vsec = bpm.VmeSeconds();
00143 int vmsec = bpm.VmeNanoseconds()/1000000;
00144 double vme = (1.0*vsec) + (vmsec/1000.0);
00145 bpm_br->vme_sec = vsec;
00146 bpm_br->vme_msec = vmsec;
00147 bpm_br->vme_ts = vme;
00148
00149 #if 0
00150 cout.precision(20);
00151 cout << "BPM: " << bpm_name
00152 << " VME@ " << vsec << "." << vmsec << " = " << vme << ", DAE@"
00153 << sec << "." << msec << " = " << dst << endl;
00154 cout << rbd->GetData()[205] << " "
00155 << rbd->GetData()[206] << " "
00156 << rbd->GetData()[207] << " "
00157 << rbd->GetData()[208] << endl;
00158 #endif
00159 }
00160 return true;
00161 }
|
|
|
Definition at line 29 of file Bdnt.cxx. Referenced by Bdnt::AddBpm(), and Fill(). |
|
|
Definition at line 24 of file Bdnt.cxx. Referenced by Bdnt::Bdnt(), and Bdnt::Write(). |
|
|
Definition at line 27 of file Bdnt.cxx. Referenced by Bdnt::AddSwic(), and Fill(). |
|
|
Definition at line 25 of file Bdnt.cxx. Referenced by Bdnt::AddBpm(), Bdnt::AddSwic(), Bdnt::Bdnt(), Bdnt::GetTree(), Bdnt::ProcessFile(), and Bdnt::Write(). |
|
|
Definition at line 30 of file Bdnt.cxx. Referenced by Bdnt::Bdnt(). |
|
|
Definition at line 31 of file Bdnt.cxx. Referenced by Bdnt::Bdnt(), and Fill(). |
1.3.9.1