Filling histograms after a a regular time interval

Hello Experts,

I wanted to know how should I fill in a 1D histogram for nhits after an interval of 1.2e9 secs. I am attaching the block of code for your ref along with the terminal result, What I am trying to do now is to get nhit distributions in each of these time intervals.

for (Long64_t iHit=0; iHit<nHits;iHit++)
		{ //##
         	   if (RecoHitPos[iHit][0] != -999) {
			double boundary = RecoHitPos[iHit][3];
			double t = 0.0;
     			   while (t < boundary || t == boundary) 
          				t += 1.2e9;

		std::cout << "Number of entries corresponding to each t value:" << std::endl;
 		for (const auto& entry : t_entry_count_map) 
			cout << "t: " << entry.first << ",	Entry count: " << entry.second <<" ,	Occupancy per spill: "<<entry.second*100/19200<<"%"<< endl;

Screenshot from 2024-05-15 15-39-15 also attaching how the distribution looks like as a whole
Screenshot from 2024-05-15 15-40-28

Kindly let me know hoe get the distribution.


Thanks for the post.
How can we help from the ROOT standpoint? If I understand correctly, this is not a technical question about ROOT, but more something relative to the study you are carrying out, right?