// Loop over all TkrDigis
TIter tkrIter(tkrDigiCol);
TkrDigi *tkr = 0;
while (tkr = (TkrDigi*)tkrIter.Next()) {
// Identify the tower and layer
Int_t tower = tkr->getTower().id();
Int_t layer = tkr->getBilayer();
// get to ToT
Int_t tot0 = tkr->getToT(0);
Int_t tot1 = tkr->getToT(1);
Int_t lastController0 = tkr->getLastController0Strip();
// Returns the orientation of the strips
GlastAxis::axis view = tkr->getView();
UInt_t numHits = tkr->getNumHits();
totalHits += numHits;
// Loop through collection of hit strips for this TkrDigi
UInt_t ihit;
for (ihit = 0; ihit < numHits; ihit++) {
// Retrieve the strip number
Int_t stripNum = tkr->getStrip(ihit);
if (layer == 5)
((TH1F*)GetObjectPtr("TKRSTRIPSLYR5"))->Fill(stripNum);
}
}
|
Create a ROOT iterator (TIter) for looping over the full collection of TkrDigis, the while loop uses this iterator to control the looping, where tkr then contains the current TkrDigi* object.
Next determine the tower and layer number of the TkrDigi.
Retrieve the ToT from both ends.
Find which strip is the last one associated with controller zero.
Determine the orientation (view: X or Y) of the TkrDigi.
Find the number of hits associated with this TkrDigi.
Then loop over all the strips and find their strip numbers, if we are on bilayer 5, update the TKRSTRIPSLYR5 histogram with the current strip number. |