Skip to content

Commit

Permalink
use LCRelationNavigator in DDSimpleMuonDigi
Browse files Browse the repository at this point in the history
  • Loading branch information
fdplacido committed Aug 19, 2021
1 parent d32cfab commit cfb1fc7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/DDSimpleMuonDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <IMPL/LCRelationImpl.h>
#include <EVENT/LCParameters.h>
#include <UTIL/CellIDDecoder.h>
#include <UTIL/LCRelationNavigator.h>

// #include <algorithm>
// #include <string>
Expand Down Expand Up @@ -178,7 +179,9 @@ void DDSimpleMuonDigi::processEvent( LCEvent * evt ) {


LCCollectionVec *muoncol = new LCCollectionVec(LCIO::CALORIMETERHIT);
LCCollectionVec *relcol = new LCCollectionVec(LCIO::LCRELATION);
// Relation collection CalorimeterHit, SimCalorimeterHit
LCCollection* chschcol = 0;
UTIL::LCRelationNavigator calohitNav = UTIL::LCRelationNavigator( LCIO::CALORIMETERHIT, LCIO::SIMCALORIMETERHIT );

LCFlagImpl flag;

Expand Down Expand Up @@ -227,8 +230,7 @@ void DDSimpleMuonDigi::processEvent( LCEvent * evt ) {
calhit->setTime( computeHitTime(hit) );
calhit->setRawHit(hit);
muoncol->addElement(calhit);
LCRelationImpl *rel = new LCRelationImpl(calhit,hit,1.);
relcol->addElement( rel );
calohitNav.addRelation(calhit, hit, 1.0);
}

}
Expand All @@ -238,7 +240,9 @@ void DDSimpleMuonDigi::processEvent( LCEvent * evt ) {
}
muoncol->parameters().setValue(LCIO::CellIDEncoding,initString);
evt->addCollection(muoncol,_outputMuonCollection.c_str());
evt->addCollection(relcol,_outputRelCollection.c_str());
// Create and add relation collection for ECAL/HCAL to event
chschcol = calohitNav.createLCCollection();
evt->addCollection(chschcol,_outputRelCollection.c_str());


_nEvt++;
Expand Down

0 comments on commit cfb1fc7

Please sign in to comment.