#include <L1TkCluster.h>
Public Member Functions | |
void | addSimTrack (const edm::Ptr< SimTrack > &trk) |
MeasurementPoint | findAverageLocalCoordinates () const |
Average cluster coordinates and position. | |
template<> | |
MeasurementPoint | findAverageLocalCoordinates () const |
template<> | |
MeasurementPoint | findAverageLocalCoordinates () const |
MeasurementPoint | findHitLocalCoordinates (unsigned int hitIdx) const |
Single hit coordinates and position. | |
template<> | |
MeasurementPoint | findHitLocalCoordinates (unsigned int hitIdx) const |
template<> | |
MeasurementPoint | findHitLocalCoordinates (unsigned int hitIdx) const |
unsigned int | findSimTrackId () const |
int | findType () const |
unsigned int | findWidth () const |
Cluster width. | |
template<> | |
unsigned int | findWidth () const |
template<> | |
unsigned int | findWidth () const |
DetId | getDetId () const |
Detector element. | |
std::vector< T > | getHits () const |
Hits in the Cluster. | |
std::vector< edm::Ptr< SimTrack > > | getSimTrackPtrs () const |
MC Truth. | |
unsigned int | getStackMember () const |
bool | isCombinatoric () const |
bool | isGenuine () const |
bool | isUnknown () const |
L1TkCluster (std::vector< T > aHits, DetId aDetId, unsigned int aStackMember) | |
Another Constructor. | |
L1TkCluster () | |
Constructors. | |
std::string | print (unsigned int i=0) const |
Information. | |
void | setDetId (DetId aDetId) |
void | setHits (std::vector< T > aHits) |
void | setStackMember (unsigned int aStackMember) |
~L1TkCluster () | |
Destructor. | |
Private Attributes | |
DetId | theDetId |
std::vector< T > | theHits |
Data members. | |
std::vector< edm::Ptr< SimTrack > > | theSimTracks |
unsigned int | theStackMember |
//////////////////////////////////////// Stacked Tracker Simulations /// / Nicola Pozzobon, UNIPD /// Emmanuele Salvati, Cornell /// / 2011, June /// 2011, October /// 2012, August /// 2013, January /// ////////////////////////////////////// ************************ DECLARATION OF CLASS ************************
Definition at line 38 of file L1TkCluster.h.
L1TkCluster< T >::L1TkCluster | ( | ) |
Constructors.
Close class.
***************************** IMPLEMENTATION OF METHODS ***************************** Default Constructor NOTE: to be used with setSomething(...) methods
Set default data members
Definition at line 100 of file L1TkCluster.h.
{ theHits.clear(); theDetId = 0; theStackMember = 0; theSimTracks.clear(); }
L1TkCluster< T >::L1TkCluster | ( | std::vector< T > | aHits, |
DetId | aDetId, | ||
unsigned int | aStackMember | ||
) |
Another Constructor.
Set default data members
Definition at line 111 of file L1TkCluster.h.
References j.
{ theHits.clear(); for ( unsigned int j = 0; j < aHits.size(); j++ ) theHits.push_back( aHits.at(j) ); theDetId = aDetId; theStackMember = aStackMember; theSimTracks.clear(); }
L1TkCluster< T >::~L1TkCluster | ( | ) |
void L1TkCluster< T >::addSimTrack | ( | const edm::Ptr< SimTrack > & | trk | ) | [inline] |
Definition at line 63 of file L1TkCluster.h.
References L1TkCluster< T >::theSimTracks.
Referenced by StackedTrackerGeometry::checkSimTrack().
{ theSimTracks.push_back(trk);}
MeasurementPoint L1TkCluster< T >::findAverageLocalCoordinates | ( | ) | const |
Average cluster coordinates and position.
Unweighted average local cluster coordinates Default template for PixelDigis
Loop over the hits and calculate the average coordinates
Definition at line 313 of file L1TkCluster.h.
{ double averageCol = 0.0; double averageRow = 0.0; if ( theHits.size() != 0 ) { typename std::vector< T >::const_iterator hitIter; for ( hitIter = theHits.begin(); hitIter != theHits.end(); hitIter++ ) { averageCol += (*hitIter)->column(); averageRow += (*hitIter)->row(); } averageCol /= theHits.size(); averageRow /= theHits.size(); } return MeasurementPoint( averageRow, averageCol ); }
MeasurementPoint L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findAverageLocalCoordinates | ( | ) | const |
Unweighted average local cluster coordinates Specialize the template for PSimHits in *cc
MeasurementPoint L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findAverageLocalCoordinates | ( | ) | const |
Unweighted average local cluster coordinates Default template for PixelDigis in *.h Specialize the template for PSimHits
Dummy values
Definition at line 43 of file L1TkCluster.cc.
{ MeasurementPoint mp( 0, 0 ); return mp; }
MeasurementPoint L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findHitLocalCoordinates | ( | unsigned int | hitIdx | ) | const |
Get hit local coordinates Specialize the template for PSimHits in *cc
MeasurementPoint L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findHitLocalCoordinates | ( | unsigned int | hitIdx | ) | const |
Get hit local coordinates Default template for PixelDigis in *.h Specialize the template for PSimHits
Dummy values
Definition at line 33 of file L1TkCluster.cc.
{ MeasurementPoint mp( 0, 0 ); return mp; }
MeasurementPoint L1TkCluster< T >::findHitLocalCoordinates | ( | unsigned int | hitIdx | ) | const |
Single hit coordinates and position.
Get hit local coordinates Default template for PixelDigis
NOTE in this case, DO NOT add 0.5 to get the center of the pixel
Definition at line 296 of file L1TkCluster.h.
{ MeasurementPoint mp( theHits.at(hitIdx)->row(), theHits.at(hitIdx)->column() ); return mp; }
unsigned int L1TkCluster< T >::findSimTrackId | ( | ) | const |
Definition at line 257 of file L1TkCluster.h.
{ if ( this->isGenuine() && theSimTracks.size()>0 ) return theSimTracks.at(0)->trackId(); return 0; }
int L1TkCluster< T >::findType | ( | ) | const |
Definition at line 249 of file L1TkCluster.h.
{ if ( this->isGenuine() && theSimTracks.size()>0 ) return theSimTracks.at(0)->type(); return 999999999; }
unsigned int L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findWidth | ( | ) | const |
Cluster width Specialize the template for PSimHits in *cc
unsigned int L1TkCluster< edm::Ref< edm::PSimHitContainer > >::findWidth | ( | ) | const |
//////////////////////////////////////// Stacked Tracker Simulations /// / Nicola Pozzobon, UNIPD /// Emmanuele Salvati, Cornell /// / 2011, June /// 2011, October /// 2013, January /// ////////////////////////////////////// ***************************** IMPLEMENTATION OF METHODS ***************************** Get cluster width Default template for PixelDigis in *.h Specialize the template for PSimHits
Definition at line 24 of file L1TkCluster.cc.
{ return theHits.size(); }
unsigned int L1TkCluster< T >::findWidth | ( | ) | const |
Cluster width.
Cluster width Default template for PixelDigis
For broadside Clusters this is equivalent to theHits.size() but for 2d or neighbor Clusters this is only the actual size in RPhi
This takes care of 1-Pixel clusters
Definition at line 272 of file L1TkCluster.h.
DetId L1TkCluster< T >::getDetId | ( | void | ) | const |
Detector element.
Detector element information.
Definition at line 139 of file L1TkCluster.h.
Referenced by StackedTrackerGeometry::checkSimTrack(), StackedTrackerGeometry::findHitGlobalPosition(), and StackedTrackerGeometry::findHitLocalPosition().
{ return theDetId; }
std::vector< T > L1TkCluster< T >::getHits | ( | ) | const |
Hits in the Cluster.
Hits composing the cluster.
Data members: getABC( ... ) Helper methods: findABC( ... )
Definition at line 128 of file L1TkCluster.h.
Referenced by StackedTrackerGeometry::checkSimTrack(), StackedTrackerGeometry::findAverageGlobalPosition(), StackedTrackerGeometry::findAverageLocalPosition(), StackedTrackerGeometry::findHitGlobalPosition(), and StackedTrackerGeometry::findHitLocalPosition().
{ return theHits; }
std::vector< edm::Ptr< SimTrack > > L1TkCluster< T >::getSimTrackPtrs | ( | ) | const |
MC Truth.
MC truth information.
Definition at line 152 of file L1TkCluster.h.
{ return theSimTracks; }
unsigned int L1TkCluster< T >::getStackMember | ( | ) | const |
Definition at line 145 of file L1TkCluster.h.
Referenced by StackedTrackerGeometry::checkSimTrack(), StackedTrackerGeometry::findHitGlobalPosition(), and StackedTrackerGeometry::findHitLocalPosition().
{ return theStackMember; }
bool L1TkCluster< T >::isCombinatoric | ( | ) | const |
COMBINATORIC means that different SimTracks contribute to the cluster, which means that both a mixture of NULL pointers and good ones are present, or that all are good but there are more SimTracks associated to the cluster
Mixture of known and unknown SimTracks means true
Two different known SimTracks means true
Only unknown SimTracks means unknown, hence false
If not true, then it is false
Definition at line 188 of file L1TkCluster.h.
References funct::false, edm::Ptr< T >::isNull(), and gen::k.
{ int prevTrack = -99999; // SimTrackId storage unsigned int numberNulls = 0; // Number of non-found SimTracks unsigned int numberGoods = 0; // Number of found SimTracks for ( unsigned int k = 0; k < theSimTracks.size(); k++ ) { edm::Ptr< SimTrack > curSimTrackPtr = theSimTracks.at(k); if ( curSimTrackPtr.isNull() ) numberNulls++; else numberGoods++; if ( numberNulls > 0 && numberGoods > 0 ) return true; if ( curSimTrackPtr.isNull() == false ) { if ( theSimTracks.size() > 1 ) { if ( prevTrack < 0 ) prevTrack = curSimTrackPtr->trackId(); if ( prevTrack != (int)curSimTrackPtr->trackId() ) return true; prevTrack = curSimTrackPtr->trackId(); } } } if ( numberNulls > 0 && numberGoods == 0 ) return false; return false; }
bool L1TkCluster< T >::isGenuine | ( | ) | const |
GENUINE means that ALL hits could be associated to a SimTrack stored in the corresponding collection, AND all of these SimTracks are actually the same
Unknown SimTrack means false
Two different known SimTracks means false
If not false, then it is true
Definition at line 155 of file L1TkCluster.h.
References edm::Ptr< T >::isNull(), and gen::k.
{ int prevTrack = -99999; // SimTrackId storage if ( theSimTracks.size() == 0 ) return false; for ( unsigned int k = 0; k < theSimTracks.size(); k++ ) { edm::Ptr< SimTrack > curSimTrackPtr = theSimTracks.at(k); if ( curSimTrackPtr.isNull() ) return false; else { if ( theSimTracks.size() > 1 ) { if ( prevTrack < 0 ) prevTrack = curSimTrackPtr->trackId(); if ( prevTrack != (int)curSimTrackPtr->trackId() ) return false; prevTrack = curSimTrackPtr->trackId(); } } } return true; }
bool L1TkCluster< T >::isUnknown | ( | ) | const |
UNKNOWN means that all SimTracks pointers are NULL
A known SimTrack means false
If not false, then it is true
Definition at line 234 of file L1TkCluster.h.
References funct::false, edm::Ptr< T >::isNull(), and gen::k.
{ for ( unsigned int k = 0; k < theSimTracks.size(); k++ ) { edm::Ptr< SimTrack > curSimTrackPtr = theSimTracks.at(k); if ( curSimTrackPtr.isNull() == false ) return false; } return true; }
std::string L1TkCluster< T >::print | ( | unsigned int | i = 0 | ) | const |
Information.
Definition at line 338 of file L1TkCluster.h.
References i, j, convertSQLitetoXML_cfg::output, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string padding(""); for ( unsigned int j=0; j!=i; ++j ) padding+="\t"; std::stringstream output; output<<padding<<"L1TkCluster:\n"; padding+='\t'; output << padding << "DetId: " << theDetId.rawId() << '\n'; output << padding << "member: " << theStackMember << ", cluster size: " << theHits.size() << '\n'; return output.str(); }
void L1TkCluster< T >::setDetId | ( | DetId | aDetId | ) |
Definition at line 142 of file L1TkCluster.h.
{ theDetId = aDetId; }
void L1TkCluster< T >::setHits | ( | std::vector< T > | aHits | ) |
void L1TkCluster< T >::setStackMember | ( | unsigned int | aStackMember | ) |
Definition at line 148 of file L1TkCluster.h.
{ theStackMember = aStackMember; }
DetId L1TkCluster< T >::theDetId [private] |
Definition at line 85 of file L1TkCluster.h.
std::vector< T > L1TkCluster< T >::theHits [private] |
Data members.
Definition at line 84 of file L1TkCluster.h.
std::vector< edm::Ptr< SimTrack > > L1TkCluster< T >::theSimTracks [private] |
Definition at line 87 of file L1TkCluster.h.
Referenced by L1TkCluster< T >::addSimTrack().
unsigned int L1TkCluster< T >::theStackMember [private] |
Definition at line 86 of file L1TkCluster.h.