Re: [BLAST_ANAWARE] dst question

From: Chi Zhang (zhangchi@MIT.EDU)
Date: Wed Sep 01 2004 - 17:38:59 EDT


see also dst_filter.C, the last block of code shows how to read charge
between any pair of physics events. basically:

  TMatrix inhib_charge_p(7,7), inhib_charge_p0(7,7);
  TMatrix inhib_charge_m(7,7), inhib_charge_m0(7,7);

  //... get the scaler event

          inhib_charge_p = dst.fScaler->inhib_charge_p;
          inhib_charge_m = dst.fScaler->inhib_charge_m;

this gives the charge matrices integrated from the very first physics
event. the "_p/m" in the name stands for beam helicity.

the matrices are 7*7. and the structure goes:

        |q00, ...|
        |... Q66|

wher Q66 is a 6*6 sub matrix. Q66(i,j) is the charge on target state
(i,j). so for D2, Q66(1,6), (2,5), (3,4) will be non-zero. see also
lrn_event.cc:charge_event::Fill(...)

Chi

On Wed, 1 Sep 2004, vitaliy ziskin wrote:

> Thanks, Chi
> It seems to work now when I use "MACRO" option. One more question, if
> you don't mind. How do I read an integrated charge matrix from the
> dst. I know how do read it from the lr file, but dst is a totally
> different beast. I'm not event sure if there is such a thing in the dst
> as an integrated charge per run or fill.
>
> Cheers, Vitaliy
>
> Chi Zhang wrote:
>
> >Hi, I may know what is the problem. make sure you open dst with the proper
> >"mode":
> > dst.Open(*gRecon, gOpt->DstFile(irun), "READ", "MACRO");
> >the "MACRO" is important.
> >
> >Chris and I decided in the design phase that a few "modes" are
> >implemented. "MICRO", "MESSO" and "MACRO". In "MICRO" mode, epics and
> >scaler trees status are set to 0 so the reading of the dst is faster.
> >while in "MACRO" mode, all branches are active.
> >
> >I just update the dst_filter.C macro and I can read non-trivial
> >epics/scaler information out from dst-8136.root. It is a <100 line macro.
> >if it is not much trouble, you can compare your code to it. make sure you
> >update it, a couple lines are patched for compatibility.
> >
> >Chi
> >
> >On Tue, 31 Aug 2004, vitaliy ziskin wrote:
> >
> >
> >
> >>Chi,
> >>that's exactly what I do.
> >>I do :
> >>
> >>dst.Open(...)
> >>.....................
> >>dst.GetEntry(iev)
> >>
> >>Both dst.fEvent->fNEpics and dst.fEvent.fNScaler give me non-zero
> >>value, but the values of epics and scaler variables are zero.
> >>
> >> Vitaliy
> >>
> >>
> >>Chi Zhang wrote:
> >>
> >>
> >>
> >>>Hi, next time, maybe paste the relevant code blocks which makes it easier
> >>>than to guess what might be wrong.
> >>>
> >>>if you do:
> >>> TBLDst dst;
> >>> dst.Open(...);
> >>> dst.GetEntry(i); // here dst is a TBLDst Object
> >>>then dst.fEpics and dst.fScaler should be filled.
> >>>
> >>>if you do:
> >>> TBLDst dst;
> >>> dst.Open(...);
> >>> dst.dst->GetEntry(i); // dst.dst being a ROOT Tree
> >>>then dst.fEpics and dst.fScaler would be empty.
> >>>
> >>>TBLDst::GetEntry(int) is a wrapper arround TTree::GetEntry(int) which
> >>>after calling TTree::GetEntry(int i) upon dst::dst, executes:
> >>>
> >>> if (fEvent->fNEpics>-1 && fEvent->fNEpics<nepics) {
> >>> nbits += epics ->GetEntry(fEvent->fNEpics);
> >>> while(fFill->fFillNumber<fEpics->fFillNumber) {
> >>> GetNextFill();
> >>> }
> >>> }
> >>> else
> >>> fEpics->Clear(true);
> >>>
> >>> if (fEvent->fNScaler>-1 && fEvent->fNScaler<nscaler)
> >>> nbits += scaler->GetEntry(fEvent->fNScaler);
> >>> else
> >>> fScaler->Clear(true);
> >>>
> >>>Try use TBLDst::GetEntry(int).
> >>>
> >>>Also after TBLDst::GetEntry(), if dst.fEpics and dst.fScaler are still
> >>>empty, try:
> >>> cout<<dst.fEvent->fNEpics<<" "<<dst.fEvent.fNScaler<<endl;
> >>>if they are -1 then this physics event is not linked to any epics/scaler
> >>>events. then dst.fEpics and dst.fScaler should be empty too.
> >>>
> >>>if these numbers are none 0 yet you still have empty fEpics and fScaler,
> >>>then there s a problem I need to fix.
> >>>
> >>>Physics events not linked to scaler events might be problematic in terms
> >>>of integrated charge. those not linked to epics events might be less of a
> >>>problem.
> >>>
> >>>Chi
> >>>
> >>>On Tue, 31 Aug 2004, vitaliy ziskin wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>When I try to get information about dst.fEpics and dst.fScaler variables
> >>>>I get all zeros (for example dst.fEpics->fFillNumber). dst.fEvent seems
> >>>>to work ok. Why is that? Does this mean that the scaler and epics info
> >>>>is not loaded into the dst? I'm using runs 8138 and 8136.
> >>>>
> >>>> I would appreciate your help,
> >>>>Vitaliy
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
>



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:31 EST