<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <font size="2">issue:<br>
      while looping over DTAGMHit ojects I want to get the associated
      object DTAGMDigiHit since<br>
      a DTAGMHit object is made as a match between DTAGMDigiHit and
      DTAGMTDCDigiHit.<br>
      However, when using the GetSingle() method it returns at times
      NULL. This should<br>
      not be possible.<br>
      Any idea why that can be?<br>
      <br>
      here the code I use: <br>
        vector <const DTAGMHit*> TagMHits =
      event->Get<DTAGMHit>();<br>
        for (unsigned int k=0; k<TagMHits.size(); k++){<br>
      <br>
          const DTAGMHit *hit = TagMHits[k];<br>
          const DTAGMDigiHit *dh =
      hit->GetSingle<DTAGMDigiHit>();<br>
          if (!dh){<br>
            //cout<<"Error no associated object DTAGMDigiHit
      found!" << endl;<br>
            continue;<br>
          }<br>
          tagmAMPmatched->Fill((double)dh->column,
      (double)dh->pulse_peak);<br>
          tagmADCtimeMatched->Fill((double)dh->column,
      (double)dh->pulse_time*0.0625);<br>
        }<br>
      <br>
    </font>
  </body>
</html>