@@ -620,8 +620,6 @@ jerror_t DEventSourceREST::Extract_DBeamPhoton(hddm_r::HDDM *record,
620
620
{
621
621
if (locTAGMiter->getJtag () != tag)
622
622
continue ;
623
-
624
- DBeamPhoton* gamma = new DBeamPhoton ();
625
623
626
624
// load the counter number (if it exists) and set the energy based on the counter
627
625
unsigned int column = 0 ;
@@ -654,12 +652,14 @@ jerror_t DEventSourceREST::Extract_DBeamPhoton(hddm_r::HDDM *record,
654
652
continue ;
655
653
}
656
654
657
- double Elo = tagmGeom->getElow (column);
658
- double Ehi = tagmGeom->getEhigh (column);
659
- double Ebeam = (Elo + Ehi)/2 .;
655
+ DBeamPhoton* gamma = new DBeamPhoton ();
656
+
657
+ double Elo_tagm = tagmGeom->getElow (column);
658
+ double Ehi_tagm = tagmGeom->getEhigh (column);
659
+ double Ebeam_tagm = (Elo_tagm + Ehi_tagm)/2 .;
660
660
661
661
// read the rest of the data from the REST file
662
- DVector3 mom (0.0 , 0.0 , Ebeam );
662
+ DVector3 mom (0.0 , 0.0 , Ebeam_tagm );
663
663
gamma->setPID (Gamma);
664
664
gamma->setMomentum (mom);
665
665
gamma->setPosition (pos);
@@ -682,16 +682,14 @@ jerror_t DEventSourceREST::Extract_DBeamPhoton(hddm_r::HDDM *record,
682
682
if (locTAGHiter->getJtag () != tag)
683
683
continue ;
684
684
685
- DBeamPhoton* gamma = new DBeamPhoton ();
686
-
687
685
// load the counter number (if it exists) and set the energy based on the counter
688
686
unsigned int counter = 0 ;
689
687
hddm_r::TaghChannelList &locTaghChannelList = locTAGHiter->getTaghChannels ();
690
688
if (locTaghChannelList.size () > 0 ) {
691
689
// it's easy if the column is already set
692
690
counter = locTaghChannelList ().getCounter ();
693
691
} else {
694
- // if the TAGM column isn't saved in the REST file, then we do one of two things
692
+ // if the TAGH column isn't saved in the REST file, then we do one of two things
695
693
// 1) if there's no special CCDB context associated with the file, we can just
696
694
// reverse engineer the counter, assuming the latest CCDB
697
695
// 2) If there is a special CCDB context specified, then use that instead
@@ -715,7 +713,13 @@ jerror_t DEventSourceREST::Extract_DBeamPhoton(hddm_r::HDDM *record,
715
713
continue ;
716
714
}
717
715
718
- DVector3 mom (0.0 , 0.0 , locTAGHiter->getE ());
716
+ DBeamPhoton* gamma = new DBeamPhoton ();
717
+
718
+ double Elo_tagh = taghGeom->getElow (counter);
719
+ double Ehi_tagh = taghGeom->getEhigh (counter);
720
+ double Ebeam_tagh = (Elo_tagh + Ehi_tagh)/2 .;
721
+
722
+ DVector3 mom (0.0 , 0.0 , Ebeam_tagh);
719
723
gamma->setPID (Gamma);
720
724
gamma->setMomentum (mom);
721
725
gamma->setPosition (pos);
0 commit comments