Skip to content
Snippets Groups Projects
Commit ab84df8c authored by Ke Li's avatar Ke Li
Browse files

add the default value for persist spacepoint

parent 421ebc71
No related branches found
No related tags found
No related merge requests found
......@@ -13,13 +13,17 @@ class FaserSCT_SpacePointCollection_p0 {
friend class FaserSCT_SpacePointClusterCnv_p0;
unsigned int m_idHash;
unsigned int m_id;
unsigned long long m_id;
unsigned int m_begin;
unsigned int m_end;
unsigned short m_size;
};
inline
FaserSCT_SpacePointCollection_p0::FaserSCT_SpacePointCollection_p0() : m_idHash(0) { }
FaserSCT_SpacePointCollection_p0::FaserSCT_SpacePointCollection_p0() : m_idHash(0),
m_id(0),
m_begin(0),
m_end(0),
m_size(0){ }
#endif // SPACEPOINTCOLLECTION_P0_H
......@@ -15,8 +15,8 @@ class FaserSCT_SpacePoint_p0 {
private:
unsigned int m_idHash0;
unsigned int m_idHash1;
unsigned long long int m_id0;
unsigned long long int m_id1;
unsigned long long m_id0;
unsigned long long m_id1;
float m_localpos_x;
float m_localpos_y;
......
......@@ -55,7 +55,7 @@ FaserSCT_SpacePointCnv_p0::persToTrans(const FaserSCT_SpacePoint_p0* persObj, Tr
} else {
log<<MSG::DEBUG<<"SCT Cluster Container found" <<endmsg;
}
const Tracker::FaserSCT_ClusterCollection *ptr = h_sctClusCont->indexFindPtr(persObj->m_idHash0);
const Tracker::FaserSCT_ClusterCollection *ptr = h_sctClusCont->indexFindPtr(IdentifierHash(persObj->m_idHash0));
// if we find PRD, then recreate link
if (ptr!=nullptr) {
//loop though collection to find matching PRD.
......@@ -67,7 +67,7 @@ FaserSCT_SpacePointCnv_p0::persToTrans(const FaserSCT_SpacePoint_p0* persObj, Tr
}
}
const Tracker::FaserSCT_ClusterCollection *ptr1 = h_sctClusCont->indexFindPtr(persObj->m_idHash1);
const Tracker::FaserSCT_ClusterCollection *ptr1 = h_sctClusCont->indexFindPtr(IdentifierHash(persObj->m_idHash1));
// if we find PRD, then recreate link
if (ptr1!=nullptr) {
//loop though collection to find matching PRD.
......
......@@ -17,11 +17,14 @@ void FaserSCT_SpacePointContainerCnv_p0::persToTrans(const FaserSCT_SpacePointCo
FaserSCT_SpacePointCnv_p0 chanCnv;
unsigned int collBegin(0);
log<<MSG::VERBOSE<<" create Spacepoint container with "<<persObj->m_spacepoint_collections.size()<<" collections"<<endmsg;
for (unsigned int icoll = 0; icoll < persObj->m_spacepoint_collections.size(); ++icoll) {
const FaserSCT_SpacePointCollection_p0& pcoll = persObj->m_spacepoint_collections[icoll];
IdentifierHash collIDHash(IdentifierHash(pcoll.m_idHash));
coll = new FaserSCT_SpacePointCollection(collIDHash);
coll->setIdentifier(Identifier(pcoll.m_id));
log<<MSG::VERBOSE<<" create Spacepoint collection with identifier "<<pcoll.m_id<<" , and hash "<<pcoll.m_idHash<<" , and size ="<<pcoll.m_end - pcoll.m_begin<<endmsg;
unsigned int nchans = pcoll.m_end - pcoll.m_begin;
coll->resize(nchans);
for (unsigned int ichan = 0; ichan < nchans; ++ ichan) {
......@@ -69,6 +72,7 @@ void FaserSCT_SpacePointContainerCnv_p0::transToPers(const FaserSCT_SpacePointCo
pcollection.m_size = collection.size();
pcollection.m_idHash = (unsigned int)collection.identifyHash();
pcollection.m_id = collection.identify().get_compact();
log<<MSG::VERBOSE<<"Trans to Pers: create Spacepoint collection with identifier "<<collection.identify().get_compact()<<" , and hash "<<collection.identifyHash()<<" , and size ="<<collection.size()<<endmsg;
//lastIdHash = collection.identifyHash();
spId = nextSpId;
......@@ -89,7 +93,7 @@ void FaserSCT_SpacePointContainerCnv_p0::transToPers(const FaserSCT_SpacePointCo
//================================================================
FaserSCT_SpacePointContainer* FaserSCT_SpacePointContainerCnv_p0::createTransient(const FaserSCT_SpacePointContainer_p0* persObj, MsgStream& log) {
log << MSG::DEBUG << "FaserSCT_SpacePointContainerCnv_p3::createTransient called " << endmsg;
std::unique_ptr<FaserSCT_SpacePointContainer> trans(std::make_unique<FaserSCT_SpacePointContainer>(1000));
std::unique_ptr<FaserSCT_SpacePointContainer> trans(std::make_unique<FaserSCT_SpacePointContainer>(persObj->m_spacepoint_collections.size()));
persToTrans(persObj, trans.get(), log);
return(trans.release());
}
......@@ -318,17 +318,19 @@ namespace Tracker
}
// save all the cluster information
if(m_saveallcluster){
msg(MSG::INFO) << "reading the cluster container" << endmsg;
ATH_MSG_DEBUG( "SCT cluster container found: " << sct_clcontainer->size() << " collections" );
Tracker::FaserSCT_ClusterContainer::const_iterator clusit = sct_clcontainer->begin();
Tracker::FaserSCT_ClusterContainer::const_iterator clusend = sct_clcontainer->end();
for (; clusit != clusend; ++clusit){
const Tracker::FaserSCT_ClusterCollection *colNext=&(**clusit);
FaserSCT_ClusterCollection::const_iterator clusters {colNext->begin()} ;
FaserSCT_ClusterCollection::const_iterator clustersEnd {colNext->end() };
for (; clusters != clustersEnd; ++clusters)
{
const Tracker::FaserSCT_Cluster* clus=&(**clusters);
m_cluster_all_global_x.push_back(clus->globalPosition().x());
Tracker::FaserSCT_ClusterContainer::const_iterator clusend = sct_clcontainer->end();
for (; clusit != clusend; ++clusit){
++m_numberOfClusterCol;
const Tracker::FaserSCT_ClusterCollection *colNext=&(**clusit);
FaserSCT_ClusterCollection::const_iterator clusters {colNext->begin()} ;
FaserSCT_ClusterCollection::const_iterator clustersEnd {colNext->end() };
for (; clusters != clustersEnd; ++clusters)
{
++m_numberOfCluster;
const Tracker::FaserSCT_Cluster* clus=&(**clusters);
m_cluster_all_global_x.push_back(clus->globalPosition().x());
m_cluster_all_global_y.push_back(clus->globalPosition().y());
m_cluster_all_global_z.push_back(clus->globalPosition().z());
m_cluster_all_local_x.push_back(clus->localPosition().x());
......@@ -364,11 +366,13 @@ namespace Tracker
FaserSCT_SpacePointContainer::const_iterator itend = sct_spcontainer->end();
for (; it != itend; ++it){
++m_numberOfSPCol;
const FaserSCT_SpacePointCollection *colNext=&(**it);
FaserSCT_SpacePointCollection::const_iterator sp_begin= colNext->begin();
FaserSCT_SpacePointCollection::const_iterator sp_end= colNext->end();
Identifier elementID = colNext->identify();
for (; sp_begin != sp_end; ++sp_begin){
++m_numberOfSP;
const Tracker::FaserSCT_SpacePoint* sp=&(**sp_begin);
m_sp_all_x.push_back(sp->globalPosition().x());
m_sp_all_y.push_back(sp->globalPosition().y());
......@@ -391,10 +395,8 @@ namespace Tracker
}
}
// register the IdentifiableContainer into StoreGate
ATH_MSG_DEBUG( "SCT spacepoint container found: " << sct_spcontainer->size() << " collections" );
FaserSCT_SpacePointContainer::const_iterator it = sct_spcontainer->begin();
FaserSCT_SpacePointContainer::const_iterator itend = sct_spcontainer->end();
......@@ -412,6 +414,8 @@ namespace Tracker
// Create SpacePointCollection
// IdentifierHash idHash = colNext->identifyHash();
Identifier elementID = colNext->identify();
ATH_MSG_VERBOSE("reading SpacePoints collection "<<elementID.get_compact()<<" , and hash = "<<colNext->identifyHash() );
int istation = m_idHelper->station(elementID);
int ilayer = m_idHelper->layer(elementID);
int ietamodule = m_idHelper->eta_module(elementID);
......@@ -423,7 +427,7 @@ namespace Tracker
m_hist_layer->Fill(ilayer);
size_t size = colNext->size();
if (size == 0){
ATH_MSG_VERBOSE( "TrackerSPFit algorithm found no space points" );
ATH_MSG_DEBUG( "TrackerSPFit algorithm found no space points" );
} else {
//In a MT environment the cache maybe filled by another thread in which case this will delete the duplicate
FaserSCT_SpacePointCollection::const_iterator sp_begin= colNext->begin();
......@@ -438,11 +442,12 @@ namespace Tracker
m_hist_y->Fill(gloPos.y());
m_hist_z->Fill(gloPos.z());
struct SP_Seed tmp{gloPos,sp->globCovariance(),ilayer,imodule};
if(istation<=1)
ATH_MSG_DEBUG( "TrackerSPFit algorithm found no space points" );
if(istation==1)
sp_sta0.push_back(tmp);
if(istation==2)
else if(istation==2)
sp_sta1.push_back(tmp);
if(istation==3)
else
sp_sta2.push_back(tmp);
if ( ((istation-1)*3+ilayer) == 0 ) m_hist_x_y_plane0->Fill(gloPos.x(),gloPos.y());
......@@ -578,6 +583,8 @@ namespace Tracker
if(ifTrack)
m_tree->Fill();
else if(m_saveallcluster||m_saveallsp)
m_tree->Fill();
return StatusCode::SUCCESS;
}
......@@ -586,8 +593,10 @@ namespace Tracker
{
ATH_MSG_INFO( "TrackerSPFit::finalize()" );
ATH_MSG_INFO( m_numberOfEvents << " events processed" );
ATH_MSG_INFO( m_numberOfSCT << " sct collections processed" );
ATH_MSG_INFO( m_numberOfSP<< " sct SP collections processed" );
ATH_MSG_INFO( m_numberOfClusterCol<< " sct Cluster collections processed" );
ATH_MSG_INFO( m_numberOfCluster<< " sct Cluster processed" );
ATH_MSG_INFO( m_numberOfSPCol<< " sct SP collections processed" );
ATH_MSG_INFO( m_numberOfSP<< " sct SP processed" );
return StatusCode::SUCCESS;
}
......
......@@ -117,6 +117,9 @@ namespace Tracker
mutable std::atomic<int> m_numberOfSCT{0};
mutable std::atomic<int> m_numberOfTrack{0};
mutable std::atomic<int> m_numberOfSP{0};
mutable std::atomic<int> m_numberOfCluster{0};
mutable std::atomic<int> m_numberOfSPCol{0};
mutable std::atomic<int> m_numberOfClusterCol{0};
//@}
TH1* m_hist_x;
TH1* m_hist_y;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment