本文整理汇总了C++中Hits::findClustersFromHits方法的典型用法代码示例。如果您正苦于以下问题:C++ Hits::findClustersFromHits方法的具体用法?C++ Hits::findClustersFromHits怎么用?C++ Hits::findClustersFromHits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hits
的用法示例。
在下文中一共展示了Hits::findClustersFromHits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Tracks * getTracks(Int_t Runs, Int_t dataType, Int_t frameType, Float_t energy, Float_t *x, Float_t *y) {
run_energy = energy;
DataInterface * di = new DataInterface();
Misalign * m = new Misalign();
Int_t nClusters = kEventsPerRun * 5 * nLayers;
Int_t nHits = kEventsPerRun * 50;
Int_t nTracks = kEventsPerRun * 2;
Bool_t breakSignal = false;
CalorimeterFrame *cf = new CalorimeterFrame();
Clusters * clusters = new Clusters(nClusters);
Clusters * trackerClusters = new Clusters(nClusters);
Hits * hits = new Hits(nHits);
Hits * eventIDs = new Hits(kEventsPerRun * sizeOfEventID);
Int_t eventID = -1;
Hits * trackerHits = new Hits(nHits);
Tracks * calorimeterTracks = nullptr;
Tracks * trackerTracks = new Tracks(nTracks);
Tracks * allTracks = new Tracks(nTracks * Runs);
TRandom3 * gRandom = new TRandom3(0);
TStopwatch t1, t2, t3, t4, t5, t6;
ofstream file("OutputFiles/efficiency.csv", ofstream::out | ofstream::app);
Int_t totalNumberOfFrames = 0;
Int_t tracksTotalNumberAfterRecon = 0;
Int_t tracksRemovedDueToBadChannels = 0;
Int_t tracksGivenToReconstruction = 0;
Int_t tracksRemovedDueToLeavingDetector = 0;
Int_t tracksRemovedDueToNuclearInteractions = 0;
Int_t clustersInFirstLayer = 0;
Int_t tracksRemovedDueToCollisions = 0;
// file: np; number of reconstructed tracks; tracks after removeTracksLeavingDetector; tracks after removeTrackCollisions
for (Int_t i=0; i<Runs; i++) {
cout << "Finding track " << (i+1)*kEventsPerRun << " of " << Runs*kEventsPerRun << "... ";
if (dataType == kMC) {
t1.Start();
eventID = di->getMCFrame(i, cf, x, y);
di->getEventIDs(i, eventIDs);
t1.Stop(); t2.Start();
showDebug("Start diffuseFrame\n");
cf->diffuseFrame(gRandom);
showDebug("End diffuseFrame, start findHits\n");
t2.Stop(); t3.Start();
hits = cf->findHits(eventID);
showDebug("Number of hits in frame: " << hits->GetEntriesFast() << endl);
t3.Stop(); t4.Start();
clusters = hits->findClustersFromHits(); // badly optimized
cout << "Found " << clusters->GetEntriesInLayer(0) << " clusters in the first layer.\n";
cout << "Found " << clusters->GetEntriesInLayer(1) << " clusters in the second layer.\n";
clusters->removeSmallClusters(2);
cout << "Found " << clusters->GetEntriesInLayer(0) << " clusters in the first layer after removeSmallClusters.\n";
t4.Stop();
clusters->matchWithEventIDs(eventIDs);
eventIDs->Clear();
}
else if (dataType == kData) {
t1.Start(); di->getDataFrame(i, cf, energy); t1.Stop();
t3.Start(); hits = cf->findHits(); t3.Stop();
t4.Start(); clusters = hits->findClustersFromHits(); t4.Stop();
clusters->removeSmallClusters(2);
clusters->removeAllClustersAfterLayer(8); // bad data in layer 10 and 11
cout << "Found " << clusters->GetEntriesInLayer(0) << " clusters in the first layer.\n";
cout << "Found " << clusters->GetEntriesInLayer(1) << " clusters in the second layer.\n";
m->correctClusters(clusters);
}
t5.Start();
calorimeterTracks = clusters->findCalorimeterTracks();
t5.Stop();
tracksTotalNumberAfterRecon += calorimeterTracks->GetEntries();
if (calorimeterTracks->GetEntriesFast() == 0) breakSignal = kTRUE; // to stop running
// Track improvements
Int_t nTracksBefore = 0, nTracksAfter = 0;
Int_t nIsInelastic = 0, nIsNotInelastic = 0;
calorimeterTracks->extrapolateToLayer0();
calorimeterTracks->splitSharedClusters();
nTracksBefore = calorimeterTracks->GetEntries();
calorimeterTracks->removeTracksLeavingDetector();
nTracksAfter = calorimeterTracks->GetEntries();
//.........这里部分代码省略.........