/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimMuon/Neutron/src/RootChamberWriter.cc
29 строк
929 B
Cms Build
Clang-Format
09 май 2019, 07:18
09 май 2019, 07:18
90d84a5
Код
Авторство
О чём код?
#include "SimMuon/Neutron/src/RootChamberWriter.h" #include "SimMuon/Neutron/src/RootSimHit.h" #include <iostream> using namespace std; RootChamberWriter::RootChamberWriter(const std::string& treeName) { theHits = new TClonesArray("RootSimHit"); theTree = new TTree(treeName.c_str(), "Neutron Background"); theTree->Bronch("Hits", "TClonesArray", &theHits); } RootChamberWriter::~RootChamberWriter() { //std::cout << "WRITING " << theTree->GetEntries() << std::endl; // theTree->Write(); //delete theHits; //delete theTree; } void RootChamberWriter::write(const edm::PSimHitContainer& hits) { std::cout << "ENTRIES BEFORE " << theTree->GetEntries() << std::endl; theHits->Delete(); theHits->Expand(hits.size()); for (unsigned int i = 0; i < hits.size(); ++i) { new ((*theHits)[i]) RootSimHit(hits[i]); } theTree->Fill(); std::cout << "ENTRIES AFTER " << theTree->GetEntries() << std::endl; }