ATLAS Offline Software
Functions
FPGATrackSimHitFilteringTool.cxx File Reference
#include "FPGATrackSimHitFilteringTool.h"
#include "PathResolver/PathResolver.h"
#include "geometry_constants.h"
#include "FPGATrackSimObjects/FPGATrackSimMultiTruth.h"
#include "FPGATrackSimObjects/FPGATrackSimCluster.h"
#include "FPGATrackSimClusteringTool.h"
#include <AsgMessaging/MessageCheck.h>
#include <vector>
#include <fstream>
#include <cmath>
#include <iostream>
#include <sstream>
#include <boost/algorithm/string.hpp>

Go to the source code of this file.

Functions

void fill_nearby_hits (const FPGATrackSimHit &, std::vector< std::pair< FPGATrackSimHit, unsigned >> &, std::vector< std::pair< FPGATrackSimHit, unsigned >> &)
 
int countHitsFromHeader (FPGATrackSimLogicalEventInputHeader &)
 
void printHitsFromHeader (FPGATrackSimLogicalEventInputHeader &)
 
void fill_nearby_hits (const FPGATrackSimHit &innerHit, std::vector< std::pair< FPGATrackSimHit, unsigned > > &outerHits, std::vector< std::pair< FPGATrackSimHit, unsigned > > &nearby_outer_hits)
 

Function Documentation

◆ countHitsFromHeader()

int countHitsFromHeader ( FPGATrackSimLogicalEventInputHeader header)

Definition at line 501 of file FPGATrackSimHitFilteringTool.cxx.

502 {
503  int nHits = 0;
504  for (int i = 0; i < header.nTowers(); ++i) {
505  FPGATrackSimTowerInputHeader &tower = *header.getTower(i);
506  std::vector<FPGATrackSimHit> hits = tower.hits();
507  nHits += hits.size();
508  }
509  return nHits;
510 }

◆ fill_nearby_hits() [1/2]

void fill_nearby_hits ( const FPGATrackSimHit ,
std::vector< std::pair< FPGATrackSimHit, unsigned >> &  ,
std::vector< std::pair< FPGATrackSimHit, unsigned >> &   
)

◆ fill_nearby_hits() [2/2]

void fill_nearby_hits ( const FPGATrackSimHit innerHit,
std::vector< std::pair< FPGATrackSimHit, unsigned > > &  outerHits,
std::vector< std::pair< FPGATrackSimHit, unsigned > > &  nearby_outer_hits 
)

Definition at line 467 of file FPGATrackSimHitFilteringTool.cxx.

468 {
469  for (const auto& outerHit : outerHits) {
470  // layer needs to be inner hit physLayer + 1
471  if(outerHit.first.getPhysLayer() != innerHit.getPhysLayer() + 1)
472  continue;
473 
474  // want to do just +-1 in eta/phi as appropriate
475  // but need to interpret module IDs first
476 
477  // for now, just do by z in barrel and rho in EC
478  // strips are at most 50mm long in barrel, 60mm long in EC
479  // adjacent one is at most a bit over 60mm away
480 
481  if(innerHit.isBarrel()) {
482  if(fabs(innerHit.getZ() - outerHit.first.getZ()) > 80)
483  continue;
484  }
485  else {
486  if(fabs(innerHit.getR() - outerHit.first.getR()) > 80)
487  continue;
488  }
489 
490  // now distance in x-y plane
491  if(fabs(innerHit.getX() - outerHit.first.getX()) > 80)
492  continue;
493  if( fabs(innerHit.getY() - outerHit.first.getY()) > 80)
494  continue;
495 
496  nearby_outer_hits.push_back(outerHit);
497  }
498 }

◆ printHitsFromHeader()

void printHitsFromHeader ( FPGATrackSimLogicalEventInputHeader header)

Definition at line 513 of file FPGATrackSimHitFilteringTool.cxx.

514 {
515  for (int i = 0; i < header.nTowers(); ++i) {
516  FPGATrackSimTowerInputHeader &tower = *header.getTower(i);
517  std::vector<FPGATrackSimHit> hits = tower.hits();
518  ANA_MSG_DEBUG("tower " << i << " with " << hits.size() << " hits:");
519  for(const auto& hit : hits) {
520  ANA_MSG_DEBUG(" isStrip, side, x, y, z, rho, phi, physLayer, layer, section, phiM, etaM = " << hit.isStrip() << ", " << hit.getPhysLayer()%2 << ", " << hit.getX() << ", " << hit.getY() << ", " << hit.getZ() << ", " << hit.getR() << ", " << hit.getGPhi() << ", " << hit.getPhysLayer() << ", " << hit.getLayer() << ", " << hit.getSection() << ", " << hit.getPhiModule() << ", " << hit.getEtaModule());
521  }
522  }
523 }
header
Definition: hcg.cxx:526
FPGATrackSimHit::getPhysLayer
unsigned getPhysLayer() const
Definition: FPGATrackSimHit.cxx:67
FPGATrackSimHit::getX
float getX() const
Definition: FPGATrackSimHit.h:125
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
FPGATrackSimHit::getY
float getY() const
Definition: FPGATrackSimHit.h:126
FPGATrackSimHit::getZ
float getZ() const
Definition: FPGATrackSimHit.h:127
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:128
FPGATrackSimTowerInputHeader::hits
const std::vector< FPGATrackSimHit > & hits() const
Definition: FPGATrackSimTowerInputHeader.h:44
FPGATrackSimTowerInputHeader
Definition: FPGATrackSimTowerInputHeader.h:18
FPGATrackSimHit::isBarrel
bool isBarrel() const
Definition: FPGATrackSimHit.h:63
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288