Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions EdmToNtupleNoMask/interface/AnalysisObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ namespace tbeam {
unsigned int HVsettings;
unsigned int DUTangle;
uint32_t stubWord;
uint32_t window;
uint32_t offset;
uint32_t cwd;
uint32_t tilt;
uint32_t vcth;
int condData;
int glibStatus;
int cbc1Status;
int cbc2Status;

int cbcStatus[16];
std::map< std::string,std::vector<int> > dut_channel;
std::map< std::string,std::vector<int> > dut_row;

ClassDef(Event,1)
ClassDef(Event,2)
};
}
#endif
79 changes: 67 additions & 12 deletions EdmToNtupleNoMask/plugins/EdmToNtuple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include<vector>
#include<algorithm>
#include<iomanip>

using namespace Phase2Tracker;

EdmToNtupleNoMask::EdmToNtupleNoMask(const edm::ParameterSet& iConfig) :
Expand Down Expand Up @@ -60,6 +59,18 @@ EdmToNtupleNoMask::EdmToNtupleNoMask(const edm::ParameterSet& iConfig) :
stemp = iConfig.getParameter<std::string>("stubAddress");
stubAdd_ = std::stoul(stemp, nullptr, 16);

stemp = iConfig.getParameter<std::string>("cwdAddress");
cwdAdd_ = std::stoul(stemp, nullptr, 16);
stemp = iConfig.getParameter<std::string>("offsetAddress");
offsetAdd_ = std::stoul(stemp, nullptr, 16);
stemp = iConfig.getParameter<std::string>("windowAddress");
windowAdd_ = std::stoul(stemp, nullptr, 16);
stemp = iConfig.getParameter<std::string>("tiltAddress");
tiltAdd_ = std::stoul(stemp, nullptr, 16);

stemp = iConfig.getParameter<std::string>("vcthAddress");
vcthAdd_ = std::stoul(stemp, nullptr, 16);

if(verbosity_) {
std::cout << "tdcPhase Address=" << tdcAdd_ << std::endl;
std::cout << "HVsettings Address=" << hvAdd_ << std::endl;
Expand All @@ -83,10 +94,18 @@ void EdmToNtupleNoMask::beginJob()
tree_->Branch("hvSettings", &ev.HVsettings);
tree_->Branch("dutAngle", &ev.DUTangle);
tree_->Branch("stubWord", &ev.stubWord);
tree_->Branch("vcth", &ev.vcth);
tree_->Branch("offset", &ev.offset);
tree_->Branch("window", &ev.window);
tree_->Branch("cwd", &ev.cwd);
tree_->Branch("tilt", &ev.tilt);
tree_->Branch("condData", &ev.condData);
tree_->Branch("glibStatus", &ev.glibStatus);
tree_->Branch("cbc1Status", &ev.cbc1Status);
tree_->Branch("cbc2Status", &ev.cbc2Status);
for (int i=0; i<16; i++){
std::stringstream ss;
ss<<"cbc"<<i<<"Status";
tree_->Branch(ss.str().c_str(),&ev.cbcStatus[i]);
}
tree_->Branch("dut_channel", "std::map< std::string,std::vector<int> >", &ev.dut_channel);
tree_->Branch("dut_row", "std::map< std::string,std::vector<int> >", &ev.dut_row);
}
Expand Down Expand Up @@ -144,9 +163,22 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&

if( tr_header.getNumberOfCBC() == 2 )
{
evtInfo.cbc1Status = (int) tr_header.CBCStatus()[0];
evtInfo.cbc2Status = (int) tr_header.CBCStatus()[1];
evtInfo.cbcStatus[0] = (int) tr_header.CBCStatus()[0];
evtInfo.cbcStatus[1] = (int) tr_header.CBCStatus()[1];
for(int i = 2 ; i<16; i++){
evtInfo.cbcStatus[i]=0;
}
}
else if (tr_header.getNumberOfCBC()==16){
for (int i=0; i<16; i++){
evtInfo.cbcStatus[i]=(int) tr_header.CBCStatus()[i];
}
}
else{
for(int i=0; i<16; i++){
evtInfo.cbcStatus[i]=0;
}
}

delete buffer;
}
Expand All @@ -159,7 +191,6 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&
std::cout << "condition data not found" << std::endl;
exit(1);
}

std::vector<std::vector<Phase2TrackerCommissioningDigi> >::const_iterator i_detSet;
std::vector<Phase2TrackerCommissioningDigi>::const_iterator j_detSet;

Expand All @@ -178,17 +209,42 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&
if(key == tdcAdd_)
{
evtInfo.tdcPhase = value;
if(verbosity_) std::cout << "It corresponds to TDC key" << std::endl;
if(verbosity_) std::cout << "It corresponds to the TDC key" << std::endl;
}
else if(key == hvAdd_)
{
evtInfo.HVsettings = value;
if(verbosity_) std::cout << "It corresponds to HV key" << std::endl;
if(verbosity_) std::cout << "It corresponds to the HV key" << std::endl;
}
else if(key == DUTangAdd_)
{
evtInfo.DUTangle = value;
if(verbosity_) std::cout << "It corresponds to DUT angle key" << std::endl;
if(verbosity_) std::cout << "It corresponds to the DUT angle key" << std::endl;
}
else if(key == tiltAdd_)
{
evtInfo.tilt = value;
if(verbosity_) std::cout << "It corresponds to the tilt angle key" << std::endl;
}
else if(key == cwdAdd_)
{
evtInfo.cwd = value;
if(verbosity_) std::cout << "It corresponds to the cluster width discriminator key" << std::endl;
}
else if(key == windowAdd_)
{
evtInfo.window = value;
if(verbosity_) std::cout << "It corresponds to the stub window size angle key" << std::endl;
}
else if(key == vcthAdd_)
{
evtInfo.vcth = value;
if(verbosity_) std::cout << "It corresponds to the VCTH key" << std::endl;
}
else if(key == offsetAdd_)
{
evtInfo.offset = value;
if(verbosity_) std::cout << "It corresponds to the offset parameter key" << std::endl;
}
else if(key == stubAdd_)
{
Expand All @@ -197,7 +253,6 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&
}
}
}

edm::Handle< edm::DetSetVector<Phase2TrackerDigi> > input;
iEvent.getByLabel( "Phase2TrackerDigiProducer", "Unsparsified", input);

Expand Down Expand Up @@ -225,7 +280,7 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&
}
}

edm::Handle< edmNew::DetSetVector<SiPixelCluster> > inputCluster;
/*edm::Handle< edmNew::DetSetVector<SiPixelCluster> > inputCluster;
iEvent.getByLabel( "Phase2TrackerDigiProducer", "Sparsified", inputCluster);

if( !inputCluster.isValid() )
Expand All @@ -239,7 +294,7 @@ void EdmToNtupleNoMask::analyze(const edm::Event& iEvent, const edm::EventSetup&
{
// uint32_t detid = itc->id();
}

*/
ev = evtInfo;
tree_->Fill();
}
Expand Down
5 changes: 5 additions & 0 deletions EdmToNtupleNoMask/plugins/EdmToNtuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class EdmToNtupleNoMask : public edm::EDAnalyzer
uint32_t hvAdd_;
uint32_t DUTangAdd_;
uint32_t stubAdd_;
uint32_t cwdAdd_;
uint32_t tiltAdd_;
uint32_t vcthAdd_;
uint32_t offsetAdd_;
uint32_t windowAdd_;

uint32_t stubWord_;
int condData_;
Expand Down
9 changes: 7 additions & 2 deletions EdmToNtupleNoMask/python/EdmToNtupleNoMask_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
verbosity = cms.untracked.int32(0),
detIdVec = cms.vint32( 50000,50004,51011,51012 ),
detNamesVec = cms.vstring( "det0","det1","det2","det3" ),
tdcAddress = cms.string("0x080000000"),
tdcAddress = cms.string("0x03000000"),
hvAddress = cms.string("0x05000000"),
dutAngAddress = cms.string("0x04000000"),
stubAddress = cms.string("0x0B0000FF")
stubAddress = cms.string("0x0B0000FF"),
cwdAddress = cms.string("0x81000000"),
offsetAddress = cms.string("0x80000000"),
windowAddress = cms.string("0x82000000"),
tiltAddress = cms.string("0x83000000"),
vcthAddress = cms.string("0x08000000")
)

3 changes: 0 additions & 3 deletions EdmToNtupleNoMask/python/__init__.py

This file was deleted.

5 changes: 3 additions & 2 deletions EdmToNtupleNoMask/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<lcgdict>
<class name="tbeam::Event" ClassVersion="1">
<version ClassVersion="1" checksum="3429877205" />
<class name="tbeam::Event" ClassVersion="2">
<!-- <version ClassVersion="1" checksum="3429877205" />-->
<version ClassVersion="2" checksum="3560704238" />
</class>
<class name="std::vector<tbeam::Event>" persistent="true" />
<class name="std::map<std::string, std::vector<int> >" persistent="true" />
Expand Down
10 changes: 5 additions & 5 deletions EdmToNtupleNoMask/test/treeMaker_cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import FWCore.ParameterSet.Config as cms
import sys


process = cms.Process("treeMaker")

Expand All @@ -11,16 +13,14 @@
process.source = cms.Source("PoolSource",
# replace 'myfile.root' with the source file you want to use
fileNames = cms.untracked.vstring(
'file:/opt/sbg/data/sbgse24/data1/cms/kskovpen/tracker/TB_Jun15/GLIBDAQ/unpacked/USC.00000713.0001.A.storageManager.00.0000.root'
#'root://eoscms//store/cmst3/user/gauzinge/Data/edmnew/USC.00000478.0001.A.storageManager.00.0000.root'
#'root://eoscms//store/cmst3/user/gauzinge/Data/edmnew/USC.00000371.0001.A.storageManager.00.0000.root'
"file:"+sys.argv[2]
)
)


process.TFileService = cms.Service("TFileService",
fileName = cms.string('test.root')
fileName = cms.string('file:'+sys.argv[3])
)

#process.treeMaker.detIdVec = cms.vint32( 51001,51002,51011,51012, 51013 )
#process.treeMaker.detIdVec = cms.vint32( 51001,51002,51011,51012, 51013 )
process.p = cms.Path(process.treeMaker)