Skip to content
Snippets Groups Projects

Adapt to updated UT channel ID class and geometry

Merged Xuhao Yuan requested to merge UT-newID-and-Geo into master
Compare and Show latest version
3 files
+ 199
196
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -77,17 +77,18 @@ namespace {
/// link all particles to the specified id
void linkAll( const LHCb::LinksByKey& ilink, LHCb::LinksByKey& olink, const LHCb::MCParticles& mcParts,
LHCb::LHCbID id, const std::vector<unsigned int>& ids, BufferedType& nullMCParticles_counter, bool test = true ) {
LHCb::LHCbID id, const std::vector<unsigned int>& ids, BufferedType& nullMCParticles_counter,
bool test = true ) {
std::vector<const LHCb::MCParticle*> partList;
partList.reserve( ids.size() );
//if (test == false) std::cout<<"test in linkAll: ids.size() = "<<ids.size()<<std::endl;
// if (test == false) std::cout<<"test in linkAll: ids.size() = "<<ids.size()<<std::endl;
for ( auto subID : ids ) {
ilink.applyToLinks( subID, [&mcParts, &partList, &test, &subID]( unsigned int, unsigned int tgtIndex, float ) {
const LHCb::MCParticle* mcPart = static_cast<const LHCb::MCParticle*>( mcParts.containedObject( tgtIndex ) );
partList.push_back( mcPart );
//if (test == false){std::cout<<subID<<" ; "<<mcPart->particleID()<<" ; "<<mcPart->momentum()<<std::endl;}
// if (test == false){std::cout<<subID<<" ; "<<mcPart->particleID()<<" ; "<<mcPart->momentum()<<std::endl;}
} );
//if (test == false) std::cout<<"keyIndex.size() = "<<ilink.keyIndex().size()<<std::endl;
// if (test == false) std::cout<<"keyIndex.size() = "<<ilink.keyIndex().size()<<std::endl;
#if 0
for(auto iter : ilink.keyIndex()){
std::cout<<iter.first<<" ; "<<iter.second<<std::endl;
@@ -156,16 +157,17 @@ namespace {
struct LoopOverClusters<UT::HitHandler> {
void operator()( const UT::HitHandler& hitHandler, const LHCb::LinksByKey& clusterLink, LHCb::LinksByKey& idLink,
const LHCb::MCParticles& mcParts, BufferedType& nullMCParticles_counter ) {
//std::cout<<"A TEST IN LoopOverClusters<UT::HitHandler>"<<std::endl;
// std::cout<<"A TEST IN LoopOverClusters<UT::HitHandler>"<<std::endl;
for ( unsigned int station = 1; station < 3; station++ ) {
for ( unsigned int layer = 1; layer < 3; layer++ ) {
for ( unsigned int region = 1; region < 4; region++ ) {
for ( unsigned int sector = 1; sector < 99; sector++ ) {
for ( const auto& hit : hitHandler.hits( station, layer, region, sector ) ) {
linkAll( clusterLink, idLink, mcParts, hit.chanID(),
{boost::numeric_cast<unsigned int>( hit.chanID().channelID() )}, nullMCParticles_counter, false );
//std::cout<<"TEST IN LoopOverClusters: "<<hit.chanID()<<" <> "<<hit.chanID().channelID()<<std::endl;
//std::cout<<clusterLink<<" <<----->> "<<idLink<<std::endl;
{boost::numeric_cast<unsigned int>( hit.chanID().channelID() )}, nullMCParticles_counter,
false );
// std::cout<<"TEST IN LoopOverClusters: "<<hit.chanID()<<" <> "<<hit.chanID().channelID()<<std::endl;
// std::cout<<clusterLink<<" <<----->> "<<idLink<<std::endl;
}
}
}
@@ -259,7 +261,7 @@ public:
updateHandleLocation( *this, "UTHitsLinkLocation", "/Event/Link/Raw/UT/TightDigits" );
DataObjectReadHandle<LHCb::LinksByKey> m_xxx{this, "UTHitsLinkLocation", "/Event/Link/Raw/UT/TightDigits" };
}
#if 0
# if 0
try{
this->getProperty( "UTHitsLinkLocation", check );
std::cout<<check<<std::endl;
@@ -268,15 +270,15 @@ public:
} catch (...){}
//DataObjectReadHandle<LHCb::LinksByKey> m_xxx{this, "ODINLocation", LHCb::ODINLocation::Default};
std::cout<<"====="<<std::endl;
#endif
# endif
#if 0
# if 0
try{
this->getProperty( "UTHitsLinkLocation" );
} catch (...){}
# endif
#endif
#endif
}
}
LHCb::LinksByKey operator()( const LHCb::MCParticles& mcParts, const ContainerType&... clusters,
const LinksByKeyT<ContainerType>&... links ) const override {
Loading