<html>
<head>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
Hi Sean,<br>
<br>
First off, I'm CC-ing this to the Hall-D Offline Software mailing
list since this may be of interest to a wider audience.<br>
<br>
I can answer the question regarding getting the DBCALHit objects
that were used to make a given DBCALCluster object. You can get to
them using the Associated Objects mechanism built into JANA. First,
to see what types of associated objects a certain object has use
hd_dump with the "-a" flag like this:<br>
<br>
<tt>> hd_dump -f -s -a -DDBCALCluster hdgeant_smeared.hddm</tt><tt><br>
</tt><tt>...</tt><tt><br>
</tt><tt>================================================================</tt><tt><br>
</tt><tt>Event: 1</tt><tt><br>
</tt><tt>DBCALCluster:</tt><tt><br>
</tt><tt> r: phi: z: theta: t: E: N_cell:</tt><tt><br>
</tt><tt>---------------------------------------------------</tt><tt><br>
</tt><tt> 65.43 2.52 290.15 0.28 7.77 0.54 7 </tt><tt><br>
</tt><tt> 74.52 0.35 51.66 1.75 2.49 0.31 6 </tt><tt><br>
</tt><tt> 69.02 1.76 170.88 0.58 4.10 0.19 4 </tt><tt><br>
</tt><tt><br>
</tt><tt> [== Associated objects for row 0 ==]</tt><tt><br>
</tt><tt> DBCALPoint 0xb6c53a00</tt><tt><br>
</tt><tt> 0xb6c53b08</tt><tt><br>
</tt><tt> 0xb6c53c10</tt><tt><br>
</tt><tt> 0xb6c53d18</tt><tt><br>
</tt><tt> 0xb6c53ea8</tt><tt><br>
</tt><tt> 0xb6c53f70</tt><tt><br>
</tt><tt> 0xb6c54058</tt><tt><br>
</tt><tt> [== Associated objects for row 1 ==]</tt><tt><br>
</tt><tt> DBCALPoint 0xb6c4f1f0</tt><tt><br>
</tt><tt> 0xb6c4f288</tt><tt><br>
</tt><tt> 0xb6c4f380</tt><tt><br>
</tt><tt> 0xb6c4f488</tt><tt><br>
</tt><tt> 0xb6c4f590</tt><tt><br>
</tt><tt> 0xb6c4f698</tt><tt><br>
</tt><tt> [== Associated objects for row 2 ==]</tt><tt><br>
</tt><tt> DBCALPoint 0xb6c4f8a8</tt><tt><br>
</tt><tt> 0xb6c53490</tt><tt><br>
</tt><tt> 0xb6c535e0</tt><tt><br>
</tt><tt> 0xb6c536e8</tt><br>
<br>
This shows that DBCALCluster objects have pointers to DBCALPoint
objects attached as associated objects. You can then do the same
exercise but for DBCALPoint objects to see that they have something
called DBCALUnifiedHit attached. Finally, the DBCALUnifiedHit
objects have the DBCALHit objects attached as associated objects.<br>
<br>
To get at these using code, use the Get() method of the data object
itself. In this case, you might write something like this:<br>
<br>
<tt>vector<const DBCALCluster*> clusters;</tt><tt><br>
</tt><tt>loop->Get(clusters);</tt><tt><br>
</tt><tt>for(unsigned int i=0; i<clusters.size(); i++){</tt><tt><br>
</tt><tt><br>
</tt><tt> vector<const DBCALPoint*></tt><tt> points;</tt><tt><br>
</tt><tt> clusters[i]->Get(points);</tt><tt><br>
</tt><tt><br>
</tt><tt> for(unsigned int j=0; j<points.size(); j++){</tt><tt><br>
</tt><br>
<tt><tt> vector<const DBCALUnifiedHit*></tt><tt>
unifiedhits;</tt><tt><br>
</tt><tt> </tt></tt><tt><tt><tt>points</tt>[i]->Get(</tt></tt><tt><tt><tt><tt>unifiedhits</tt></tt>);</tt><tt><br>
</tt><br>
</tt><tt><tt> for(unsigned int k=0; k<</tt></tt><tt><tt><tt><tt>unifiedhits</tt></tt>.size();
k++){</tt><tt><br>
</tt><tt><br>
</tt></tt><tt><tt><tt><tt> vector<const
DBCALHit*></tt><tt> hits;</tt><tt><br>
</tt><tt> </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>unifiedhits</tt></tt></tt></tt><tt><tt>[i]->Get(hits</tt></tt><tt><tt>);</tt><tt><br>
</tt></tt> <br>
// Do something with the DBCALHit objects<br>
</tt><tt>
</tt><tt> }</tt><tt><br>
</tt> }</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><br>
This case is a bit more complicated than most since you want to get
at something that is a few generations back from the DBCALCluster
objects. This should be pretty quick to run though and will give you
exactly the hit objects that were ultimately used to make the
cluster. Let me know if anything is unclear.<br>
<br>
Regards,<br>
-Dave<br>
<br>
<div class="moz-cite-prefix">On 7/17/13 9:47 PM, Sean Dobbs wrote:<br>
</div>
<blockquote cite="mid:CAEAoKm7p+Pj=w96_u6nc5CGJvBuHJ0rtrxW9OoyDUB4qf9Wzow@mail.gmail.com" type="cite">
<div dir="ltr">Hi Will,
<div><br>
</div>
<div>I have some first order results you might find interesting,
and have attached a few plots to illustrate them.</div>
<div><br>
</div>
<div>The file kin_plots.pdf shows some p-theta plots to
illustrate the kinematics of the reaction that I'm looking at:
gamma p -> J/psi + p, J/psi -> e+ e-. The proton
generally goes into the FCAL, while the e-/e+ generally go
into the BCAL, and have a wide range of momenta. I made a few
modifications to your code, to pick out the e-/e+ from these
events, and it seemed to work fine.<br>
</div>
<div><br>
</div>
<div>The first two plots in bcal_plots.pdf give the
distributions of ADC energies for all BCAL hits and the most
energetic hit in a cluster, respectively. The good part is
that only about 6% of hits have energies > 4096 - the bad
part is that about 60% clusters have a hit that's higher than
that, and sometimes much higher!</div>
<div><br>
</div>
<div>By the way, is there any easy way to backtrack from a
DBCALCluster to a DBCALHit? I ended up matching the
DBCALPoints and DBCALHits by hand.</div>
<div><br>
</div>
<div><br>
</div>
<div>The last plot shows the distribution of dz v. dphi for the
e+/e- tracks, similar to what you had been showing for pion
tracks, and it at least looks like the track/shower matching
works well for electrons. So, it's looking like we might be
better off looking at shower shape variables to identify
electrons, rather than the scalar sum of shower energies. </div>
<div><br>
</div>
<div>Cheers,</div>
<div>Sean</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Jun 27, 2013 at 7:16 PM, Will
Levine <<a href="mailto:wlevine@gmail.com">wlevine@gmail.com</a>>
wrote:<br>
<blockquote class="gmail_quote">The BCAL simulation does not
currently account for the maximum<br>
amplitude of the ADC. This is something we are aware of and
I am a<br>
little bit worried about. In theory, this seems like it
should be a<br>
simple thing to fix, but there could be complications (e.g.
if the ADC<br>
saturates, then probably we should set an overflow bit to
indicate<br>
this, but adding this overflow bit would require a change in
the data<br>
model which would be a bigger change),<br>
<br>
Something you could do to check how big a problem this will
be for you<br>
is look at the DBCALHit objects in your simulated data.
These<br>
represent ADC hits and contain what is supposed to be the
ADC<br>
amplitude. The ADCs are 12 bits, so we should be worried if
a lot of<br>
these values are over 4096.<br>
<br>
I've cc'ed David Lawrence in case he has any other thoughts<br>
<div class="HOEnZb">
<div class="h5"><br>
On Thu, Jun 27, 2013 at 5:57 PM, Sean Dobbs <<a href="mailto:s-dobbs@northwestern.edu">s-dobbs@northwestern.edu</a>>
wrote:<br>
> Hi Will,<br>
><br>
> Thanks for the info! I do have something of a soft
spot for calorimeters,<br>
> but the ones that I've worked with before have all
been crystal<br>
> calorimeters, so I'm still learning about this
BCAL.<br>
><br>
> I don't mind using the latest version of the code,
so I'll let you know how<br>
> things work as soon as I can get the trunk to
compile (or find an earlier<br>
> one that will work).<br>
><br>
> One additional question - does the new simulation
include modelling of the<br>
> maximum amplitudes in the ADCs?<br>
><br>
><br>
> Cheers,<br>
> Sean<br>
><br>
><br>
> On Thu, Jun 27, 2013 at 2:13 PM, Will Levine <<a href="mailto:wlevine@gmail.com">wlevine@gmail.com</a>>
wrote:<br>
>><br>
>> Hi Sean,<br>
>> Happy to hear that someone else is interested
in the BCAL. I hope I can<br>
>> help.<br>
>><br>
>> The new(ish) BCAL reconstruction code is now
enabled by default on the<br>
>> trunk. However it didn't make it into the
latest tagged release<br>
>> (sim-recon-2013-04-22). If you are wedded to
using an older version,<br>
>> let me know and I can tell you how to enable
the new BCAL code (it's<br>
>> just a few command line switches), but
otherwise I would recommend<br>
>> upgrading to a newer version. One thing to note
is that the BCAL<br>
>> simulation changed as well, so if you have done
any simulation you<br>
>> will have to redo that.<br>
>><br>
>> I've just checked in my code for doing
track-shower matching studies,<br>
>> it's available in<br>
>>
sim-recon/src/programs/Analysis/plugins/bcal_matching .
It's designed<br>
>> to analyze single-charged-pion events but
should only need to be<br>
>> changed minimally for single-electron events.
Hopefully my code is<br>
>> clear enough.<br>
>><br>
>> Please let me know if you have any questions or
complaints or feedback.<br>
>><br>
>> Will<br>
>><br>
>> On Thu, Jun 27, 2013 at 12:00 PM, Sean Dobbs
<<a href="mailto:s-dobbs@northwestern.edu">s-dobbs@northwestern.edu</a>><br>
>> wrote:<br>
>> > Dear Will,<br>
>> ><br>
>> > I'm interested in trying out the new BCAL
reconstruction software that<br>
>> > you've been working on, with our analysis
of gamma p -> J/psi + p, J/psi<br>
>> > -><br>
>> > e+ e-, to see how it works with showers
high-energy electrons. If it's<br>
>> > in a<br>
>> > state that you wouldn't mind sharing, can
you tell me how to properly<br>
>> > enable<br>
>> > it?<br>
>> ><br>
>> > Also, would you mind sharing the code that
you used to make the<br>
>> > track-shower<br>
>> > matching plots that you showed in
yesterday's offline software meeting?<br>
>> > It's really great to see someone taking a
look at this issue, and I'd<br>
>> > like<br>
>> > to see if I see the same effects in our
analysis.<br>
>> ><br>
>> ><br>
>> > Thanks,<br>
>> > Sean<br>
>> ><br>
>> ><br>
>> > --<br>
>> > Dr. Sean Dobbs<br>
>> > Department of Physics & Astronomy<br>
>> > Northwestern University<br>
>> > phone: 847-467-2826<br>
><br>
><br>
><br>
><br>
> --<br>
> Dr. Sean Dobbs<br>
> Department of Physics & Astronomy<br>
> Northwestern University<br>
> phone: 847-467-2826<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Dr. Sean Dobbs<br>
Department of Physics & Astronomy <br>
Northwestern University<br>
phone: 847-467-2826
</div>
</blockquote>
<br>
</body>
</html>